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() {
3252
3252
switch (last.getKind ()) {
3253
3253
case ConstraintLocator::ContextualType:
3254
3254
case ConstraintLocator::ApplyArgToParam: {
3255
- auto fnType = getType (anchor)->castTo <FunctionType>();
3255
+ auto type = getType (anchor)->lookThroughAllOptionalTypes ();
3256
+ auto fnType = type->castTo <FunctionType>();
3256
3257
emitDiagnostic (diag::missing_nullary_call, fnType->getResult ())
3257
3258
.fixItInsertAfter (insertLoc, " ()" );
3258
3259
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() {
245
245
}
246
246
}
247
247
}
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