File tree Expand file tree Collapse file tree 2 files changed +16
-0
lines changed Expand file tree Collapse file tree 2 files changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -1368,6 +1368,10 @@ class AllowInvalidPropertyWrapperType final : public ConstraintFix {
1368
1368
return " allow invalid property wrapper type" ;
1369
1369
}
1370
1370
1371
+ bool diagnoseForAmbiguity (CommonFixesArray commonFixes) const override {
1372
+ return diagnose (*commonFixes.front ().first );
1373
+ }
1374
+
1371
1375
bool diagnose (const Solution &solution, bool asNote = false ) const override ;
1372
1376
1373
1377
static bool classof (const ConstraintFix *fix) {
Original file line number Diff line number Diff line change @@ -279,3 +279,15 @@ func testInvalidWrapperInference() {
279
279
// expected-error@+1 {{contextual closure type '() -> Void' expects 0 arguments, but 1 was used in closure body}}
280
280
testExtraParameter { $value in }
281
281
}
282
+
283
+ // rdar://116522161 - failed to produce a diagnostic on invalid projection use
284
+ func testInvalidProjectionInAmbiguousContext( ) {
285
+ func test< T> ( _: [ T ] , _: ( T ) -> Void ) { }
286
+
287
+ func ambiguous( ) -> Int { 42 }
288
+ func ambiguous( ) -> String { " " }
289
+
290
+ test ( [ 42 ] ) { $v in // expected-error {{inferred projection type 'Int' is not a property wrapper}}
291
+ ambiguous ( )
292
+ }
293
+ }
You can’t perform that action at this time.
0 commit comments