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 {
13681368 return " allow invalid property wrapper type" ;
13691369 }
13701370
1371+ bool diagnoseForAmbiguity (CommonFixesArray commonFixes) const override {
1372+ return diagnose (*commonFixes.front ().first );
1373+ }
1374+
13711375 bool diagnose (const Solution &solution, bool asNote = false ) const override ;
13721376
13731377 static bool classof (const ConstraintFix *fix) {
Original file line number Diff line number Diff line change @@ -279,3 +279,15 @@ func testInvalidWrapperInference() {
279279 // expected-error@+1 {{contextual closure type '() -> Void' expects 0 arguments, but 1 was used in closure body}}
280280 testExtraParameter { $value in }
281281}
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