File tree Expand file tree Collapse file tree 2 files changed +15
-1
lines changed
branches/master-next/lib/Sema Expand file tree Collapse file tree 2 files changed +15
-1
lines changed Original file line number Diff line number Diff line change 1
1
---
2
2
refs/heads/master: 3574c513bbc5578dd9346b4ea9ab5995c5927bb5
3
- refs/heads/master-next: e30612e8cd257f9a49d200bfa3b7e26999a57286
3
+ refs/heads/master-next: 881f521958be6f19e1d3ef505765f77840b026b4
4
4
refs/tags/osx-passed: b6b74147ef8a386f532cf9357a1bde006e552c54
5
5
refs/tags/swift-2.2-SNAPSHOT-2015-12-01-a: 6bb18e013c2284f2b45f5f84f2df2887dc0f7dea
6
6
refs/tags/swift-2.2-SNAPSHOT-2015-12-01-b: 66d897bfcf64a82cb9a87f5e663d889189d06d07
Original file line number Diff line number Diff line change @@ -3508,6 +3508,20 @@ bool AllowTypeOrInstanceMemberFailure::diagnoseAsError() {
3508
3508
return true ;
3509
3509
}
3510
3510
3511
+ // Function type has fewer arguments than expected by context:
3512
+ //
3513
+ // ```
3514
+ // func foo() {}
3515
+ // let _: (Int) -> Void = foo
3516
+ // ```
3517
+ if (locator->isLastElement (ConstraintLocator::ContextualType)) {
3518
+ auto &cs = getConstraintSystem ();
3519
+ emitDiagnostic (anchor->getLoc (), diag::cannot_convert_initializer_value,
3520
+ getType (anchor), resolveType (cs.getContextualType ()));
3521
+ // TODO: It would be great so somehow point out which arguments are missing.
3522
+ return true ;
3523
+ }
3524
+
3511
3525
return false ;
3512
3526
}
3513
3527
You can’t perform that action at this time.
0 commit comments