Skip to content

Commit d95ed8c

Browse files
authored
Merge pull request swiftlang#28361 from CodaFi/the-great-filter
Filter out invalid nested types from typealias override checking
2 parents ba79967 + c83c0f4 commit d95ed8c

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

lib/AST/GenericSignatureBuilder.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4102,6 +4102,10 @@ ConstraintResult GenericSignatureBuilder::expandConformanceRequirement(
41024102
auto type = dyn_cast<TypeDecl>(found);
41034103
if (!type || isa<AssociatedTypeDecl>(type)) continue;
41044104

4105+
// Ignore nominal types. They're always invalid declarations.
4106+
if (isa<NominalTypeDecl>(type))
4107+
continue;
4108+
41054109
// ... from the same module as the protocol.
41064110
if (type->getModuleContext() != proto->getModuleContext()) continue;
41074111

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
// RUN: not %target-swift-frontend -typecheck %s
2+
3+
protocol Iteratee {
4+
associatedtype Iterator
5+
}
6+
7+
protocol BidirectionalAdvancingCollection: Iteratee {
8+
struct Iterator<Elements> {}
9+
}

0 commit comments

Comments
 (0)