File tree Expand file tree Collapse file tree 2 files changed +7
-1
lines changed Expand file tree Collapse file tree 2 files changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -3252,7 +3252,8 @@ bool MissingCallFailure::diagnoseAsError() {
32523252 switch (last.getKind ()) {
32533253 case ConstraintLocator::ContextualType:
32543254 case ConstraintLocator::ApplyArgToParam: {
3255- auto fnType = getType (anchor)->castTo <FunctionType>();
3255+ auto type = getType (anchor)->lookThroughAllOptionalTypes ();
3256+ auto fnType = type->castTo <FunctionType>();
32563257 emitDiagnostic (diag::missing_nullary_call, fnType->getResult ())
32573258 .fixItInsertAfter (insertLoc, " ()" );
32583259 return true ;
Original file line number Diff line number Diff line change @@ -245,3 +245,8 @@ func test_passing_noescape_function_ref_to_generic_parameter() {
245245 }
246246 }
247247}
248+
249+ // SR-14784
250+ func SR14784< T> ( _ fs: ( ) -> T ... , a _ : Int ) -> T {
251+ fs. first! // expected-error{{function produces expected type 'T'; did you mean to call it with '()'?}} {{11-11=()}}
252+ }
You can’t perform that action at this time.
0 commit comments