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 @@ -146,7 +146,9 @@ ValueDecl *RequirementFailure::getDeclRef() const {
146
146
}
147
147
148
148
if (auto *AE = dyn_cast<CallExpr>(anchor)) {
149
- assert (isa<TypeExpr>(AE->getFn ()));
149
+ // NOTE: In valid code, the function can only be a TypeExpr
150
+ assert (isa<TypeExpr>(AE->getFn ()) ||
151
+ isa<OverloadedDeclRefExpr>(AE->getFn ()));
150
152
ConstraintLocatorBuilder ctor (locator);
151
153
locator = cs.getConstraintLocator (
152
154
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