File tree Expand file tree Collapse file tree 2 files changed +7
-2
lines changed Expand file tree Collapse file tree 2 files changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -425,7 +425,8 @@ ConstraintLocator *ConstraintSystem::getCalleeLocator(Expr *expr) {
425
425
// For an apply of a metatype, we have a short-form constructor. Unlike
426
426
// other locators to callees, these are anchored on the apply expression
427
427
// rather than the function expr.
428
- if (simplifyType (getType (fnExpr))->is <AnyMetatypeType>()) {
428
+ auto fnTy = getFixedTypeRecursive (getType (fnExpr), /* wantRValue*/ true );
429
+ if (fnTy->is <AnyMetatypeType>()) {
429
430
auto *fnLocator =
430
431
getConstraintLocator (applyExpr, ConstraintLocator::ApplyFunction);
431
432
return getConstraintLocator (fnLocator,
Original file line number Diff line number Diff line change @@ -714,7 +714,7 @@ protocol Q {
714
714
}
715
715
716
716
struct SR10694 {
717
- init < T : P > ( _ x: T ) { } // expected-note 2 {{where 'T' = 'T'}}
717
+ init < T : P > ( _ x: T ) { } // expected-note 3 {{where 'T' = 'T'}}
718
718
func bar< T> ( _ x: T , _ s: SR10694 , _ q: Q ) {
719
719
SR10694 . self ( x) // expected-error {{initializer 'init(_:)' requires that 'T' conform to 'P'}}
720
720
@@ -726,6 +726,10 @@ struct SR10694 {
726
726
727
727
type ( of: q) ( x) // expected-error {{initializer 'init(_:)' requires that 'T' conform to 'P'}}
728
728
// expected-error@-1 {{initializing from a metatype value must reference 'init' explicitly}}
729
+
730
+ var srTy = SR10694 . self
731
+ srTy ( x) // expected-error {{initializer 'init(_:)' requires that 'T' conform to 'P'}}
732
+ // expected-error@-1 {{initializing from a metatype value must reference 'init' explicitly}}
729
733
}
730
734
}
731
735
You can’t perform that action at this time.
0 commit comments