File tree 3 files changed +4
-18
lines changed
3 files changed +4
-18
lines changed Original file line number Diff line number Diff line change @@ -730,21 +730,10 @@ void SolverTrail::undo(unsigned toIndex) {
730
730
ASSERT (!UndoActive);
731
731
UndoActive = true ;
732
732
733
- // FIXME: Undo all changes in the correct order!
734
733
for (unsigned i = Changes.size (); i > toIndex; i--) {
735
734
auto change = Changes[i - 1 ];
736
- if (change.Kind == ChangeKind::UpdatedTypeVariable) {
737
- LLVM_DEBUG (llvm::dbgs () << " - " ; change.dump (llvm::dbgs (), CS, 0 ));
738
- change.undo (CS);
739
- }
740
- }
741
-
742
- for (unsigned i = Changes.size (); i > toIndex; i--) {
743
- auto change = Changes[i - 1 ];
744
- if (change.Kind != ChangeKind::UpdatedTypeVariable) {
745
- LLVM_DEBUG (llvm::dbgs () << " - " ; change.dump (llvm::dbgs (), CS, 0 ));
746
- change.undo (CS);
747
- }
735
+ LLVM_DEBUG (llvm::dbgs () << " - " ; change.dump (llvm::dbgs (), CS, 0 ));
736
+ change.undo (CS);
748
737
}
749
738
750
739
Changes.resize (toIndex);
Original file line number Diff line number Diff line change @@ -11,7 +11,7 @@ struct Data {}
11
11
extension DispatchData {
12
12
func asFoundationData< T> ( execute: ( Data ) throws -> T ) rethrows -> T {
13
13
return try withUnsafeBytes { ( ptr: UnsafePointer < Int8 > ) -> Void in
14
- // expected-error@-1 {{cannot convert return expression of type 'Void' to return type 'T'}}
14
+ // expected-error@-1 {{declared closure result 'Void' is incompatible with contextual type 'T'}}
15
15
let data = Data ( )
16
16
return try execute ( data) // expected-error {{cannot convert value of type 'T' to closure result type 'Void'}}
17
17
}
Original file line number Diff line number Diff line change @@ -273,11 +273,8 @@ func associatedTypeIdentity() {
273
273
sameType ( cr, dr) // expected-error {{conflicting arguments to generic parameter 'T' ('(some R).S' (result type of 'candace') vs. '(some R).S' (result type of 'doug'))}}
274
274
sameType ( gary ( candace ( ) ) . r_out ( ) , gary ( candace ( ) ) . r_out ( ) )
275
275
sameType ( gary ( doug ( ) ) . r_out ( ) , gary ( doug ( ) ) . r_out ( ) )
276
- // TODO(diagnostics): This is not great but the problem comes from the way solver discovers and attempts bindings, if we could detect that
277
- // `(some R).S` from first reference to `gary()` in inconsistent with the second one based on the parent type of `S` it would be much easier to diagnose.
278
276
sameType ( gary ( doug ( ) ) . r_out ( ) , gary ( candace ( ) ) . r_out ( ) )
279
- // expected-error@-1:12 {{conflicting arguments to generic parameter 'T' ('some R' (result type of 'doug') vs. 'some R' (result type of 'candace'))}}
280
- // expected-error@-2:34 {{conflicting arguments to generic parameter 'T' ('some R' (result type of 'doug') vs. 'some R' (result type of 'candace'))}}
277
+ // expected-error@-1:39 {{cannot convert value of type 'some R' (result of 'candace()') to expected argument type 'some R' (result of 'doug()')}}
281
278
}
282
279
283
280
func redeclaration( ) -> some P { return 0 } // expected-note 2{{previously declared}}
You can’t perform that action at this time.
0 commit comments