Skip to content

Commit 21ffcf1

Browse files
authored
Merge pull request #27885 from CodaFi/a-breach-of-protocol
2 parents d5c28d8 + 86e5ed1 commit 21ffcf1

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

lib/AST/GenericSignatureBuilder.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1442,6 +1442,10 @@ void RequirementSource::print(llvm::raw_ostream &out,
14421442
static Type formProtocolRelativeType(ProtocolDecl *proto,
14431443
Type baseType,
14441444
Type type) {
1445+
// Error case: hand back the erroneous type.
1446+
if (type->hasError())
1447+
return type;
1448+
14451449
// Basis case: we've hit the base potential archetype.
14461450
if (baseType->isEqual(type))
14471451
return proto->getSelfInterfaceType();
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
// RUN: not %target-typecheck-verify-swift
2+
3+
protocol P where A : Int {}

0 commit comments

Comments
 (0)