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
4 changes: 4 additions & 0 deletions lib/IDE/CodeCompletion.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1948,6 +1948,10 @@ class CompletionLookup final : public swift::VisibleDeclConsumer {
if (!MaybeNominalType->mayHaveMembers())
return T;

// We can't do anything if the base type has unbound generic parameters.
if (MaybeNominalType->hasUnboundGenericType())
return T;

// For everything else, substitute in the base type.
auto Subs = MaybeNominalType->getMemberSubstitutionMap(M, VD);

Expand Down
17 changes: 17 additions & 0 deletions validation-test/IDE/crashers_2_fixed/rdar48896424.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
// RUN: %target-swift-ide-test -code-completion -code-completion-token=COMPLETE -source-filename=%s

class Foo<T> {
}

extension Foo where T: Comparable {
func foo() {}
}

protocol P {
typealias alias = Foo
}
protocol P {}

func Test() {
P.alias.#^COMPLETE^#
}