File tree Expand file tree Collapse file tree 2 files changed +16
-1
lines changed
validation-test/Sema/type_checker_crashers_fixed Expand file tree Collapse file tree 2 files changed +16
-1
lines changed Original file line number Diff line number Diff line change @@ -136,7 +136,9 @@ ValueDecl *RequirementFailure::getDeclRef() const {
136136 auto *anchor = getRawAnchor ();
137137 auto *locator = cs.getConstraintLocator (anchor);
138138 if (auto *AE = dyn_cast<CallExpr>(anchor)) {
139- assert (isa<TypeExpr>(AE->getFn ()));
139+ // NOTE: In valid code, the function can only be a TypeExpr
140+ assert (isa<TypeExpr>(AE->getFn ()) ||
141+ isa<OverloadedDeclRefExpr>(AE->getFn ()));
140142 ConstraintLocatorBuilder ctor (locator);
141143 locator = cs.getConstraintLocator (
142144 ctor.withPathElement (PathEltKind::ApplyFunction)
Original file line number Diff line number Diff line change 1+ // RUN: not %target-swift-frontend %s -typecheck
2+
3+ protocol A { }
4+ protocol B { }
5+
6+ struct X : A { }
7+ struct Y : B { }
8+
9+ struct G < T: A > { var v : T }
10+ struct G < T: B > { var v : T }
11+
12+ let a = G ( v: X ( ) )
13+ let b = G ( v: Y ( ) )
You can’t perform that action at this time.
0 commit comments