File tree Expand file tree Collapse file tree 2 files changed +26
-0
lines changed Expand file tree Collapse file tree 2 files changed +26
-0
lines changed Original file line number Diff line number Diff line change @@ -496,6 +496,15 @@ ConstraintLocator *ConstraintSystem::getCalleeLocator(
496496 }
497497 }
498498
499+ {
500+ // Pattern match is always a callee regardless of what comes after it.
501+ auto iter = path.rbegin ();
502+ if (locator->findLast <LocatorPathElt::PatternMatch>(iter)) {
503+ auto newPath = path.drop_back (iter - path.rbegin ());
504+ return getConstraintLocator (anchor, newPath);
505+ }
506+ }
507+
499508 if (locator->findLast <LocatorPathElt::DynamicCallable>()) {
500509 return getConstraintLocator (anchor, LocatorPathElt::ApplyFunction ());
501510 }
Original file line number Diff line number Diff line change @@ -540,3 +540,20 @@ func f60503() {
540540 let ( key, _) = settings. enumerate ( ) // expected-error{{cannot find 'settings' in scope}}
541541 let ( _, _) = settings. enumerate ( ) // expected-error{{cannot find 'settings' in scope}}
542542}
543+
544+ // rdar://105089074
545+ enum EWithIdent < Id> where Id: P { // expected-note 2 {{where 'Id' = 'Int'}}
546+ case test( Id )
547+ }
548+
549+ extension [ EWithIdent < Int > ] {
550+ func test( ) {
551+ sorted { lhs, rhs in
552+ switch ( rhs, rhs) {
553+ case let ( . test( x) , . test( y) ) : break
554+ // expected-error@-1 2 {{generic enum 'EWithIdent' requires that 'Int' conform to 'P'}}
555+ case ( _, _) : break
556+ }
557+ }
558+ }
559+ }
You can’t perform that action at this time.
0 commit comments