Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions lib/AST/NameLookup.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3238,6 +3238,11 @@ static llvm::TinyPtrVector<TypeDecl *> directReferencesForQualifiedTypeLookup(
static DirectlyReferencedTypeDecls directReferencesForDeclRefTypeRepr(
Evaluator &evaluator, ASTContext &ctx, DeclRefTypeRepr *repr,
DeclContext *dc, DirectlyReferencedTypeLookupOptions options) {
// If we've already bound this TypeRepr, don't repeat the work.
if (repr->isBound()) {
return DirectlyReferencedTypeDecls({ repr->getBoundDecl() }, {});
}

if (auto *qualIdentTR = dyn_cast<QualifiedIdentTypeRepr>(repr)) {
auto result = directReferencesForTypeRepr(
evaluator, ctx, qualIdentTR->getBase(), dc, options);
Expand Down
8 changes: 8 additions & 0 deletions test/NameLookup/module_selector.swift
Original file line number Diff line number Diff line change
Expand Up @@ -440,3 +440,11 @@ func dependentTypeLookup<T, U, V, W, X>(_: T, _: U, _: V, _: W, _: X) where
X: Identifiable, X: ComparableIdentifiable, X.NonexistentModule::ID == Int
// expected-error@-1 {{module selector is not allowed on generic member type; associated types with the same name are merged instead of shadowing one another}} {{49-68=}}
{}

// rdar://164647850 -- conforming to `Swift::Error` doesn't work when there's an `Error` type around

enum Error {}
enum E: Swift::Error { case err }

func testErrorConformance() -> Result<Void, E> { .success(()) }
// no-error@-1
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// {"kind":"typecheck","signature":"swift::rewriting::RequirementMachine::areReducedTypeParametersEqual(swift::Type, swift::Type) const"}
// RUN: not --crash %target-swift-frontend -typecheck %s
// RUN: not %target-swift-frontend -typecheck %s
protocol a {
typealias Index extension Collection where Self : a{b : Index} protocol a