File tree Expand file tree Collapse file tree 2 files changed +31
-1
lines changed Expand file tree Collapse file tree 2 files changed +31
-1
lines changed Original file line number Diff line number Diff line change @@ -2444,8 +2444,16 @@ namespace {
2444
2444
expr->getArgumentLabelLocs (), expr->hasTrailingClosure (),
2445
2445
/* implicit=*/ expr->isImplicit (), Type (), getType);
2446
2446
result = finishApply (apply, Type (), cs.getConstraintLocator (expr));
2447
+
2448
+ // FIXME: Application could fail, because some of the solutions
2449
+ // are not expressible in AST (yet?), like certain tuple-to-tuple
2450
+ // conversions. Better solution here would be not to form solutions
2451
+ // which couldn't be applied by e.g. detecting situations like that
2452
+ // and inserting fixes early.
2453
+ if (!result)
2454
+ return nullptr ;
2447
2455
}
2448
-
2456
+
2449
2457
// Check for ambiguous member if the base is an Optional
2450
2458
if (baseTy->getOptionalObjectType ()) {
2451
2459
diagnoseAmbiguousNominalMember (baseTy, result);
Original file line number Diff line number Diff line change @@ -517,3 +517,25 @@ func rdar46211109() {
517
517
let _: MyIntSequenceStruct ? = foo ( Int . Self)
518
518
// expected-error@-1 {{type 'Int' has no member 'Self'}}
519
519
}
520
+
521
+ func rdar_48114578( ) {
522
+ struct S < T> {
523
+ var value : T
524
+
525
+ static func valueOf< T> ( _ v: T ) -> S < T > {
526
+ return S < T > ( value: v)
527
+ }
528
+ }
529
+
530
+ typealias A = ( a: [ String ] ? , b: Int )
531
+
532
+ func foo( _ a: [ String ] , _ b: Int ) -> S < A > {
533
+ let v = ( a, b)
534
+ return . valueOf( v)
535
+ // expected-error@-1 {{cannot express tuple conversion '([String], Int)' to '(a: [String]?, b: Int)'}}
536
+ }
537
+
538
+ func bar( _ a: [ String ] , _ b: Int ) -> S < A > {
539
+ return . valueOf( ( a, b) ) // Ok
540
+ }
541
+ }
You can’t perform that action at this time.
0 commit comments