Skip to content

[AST] Handle getSuperclassForDecl() returning an ErrorType in more places #26750

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
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
19 changes: 19 additions & 0 deletions test/IDE/complete_name_lookup.swift
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
// RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=FOO_OBJECT_DOT_1 | %FileCheck %s -check-prefix=FOO_OBJECT_DOT
// RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=BAR_OBJECT_DOT_1 | %FileCheck %s -check-prefix=BAR_OBJECT_DOT
// RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=CATCHSEQUENCE_DOT | %FileCheck %s -check-prefix=CATCHSEQUENCE_DOT

protocol FooBaseProtocol {
var instanceProperty: Int { get }
Expand Down Expand Up @@ -35,3 +36,21 @@ func test(a: BarStruct) {
a.#^BAR_OBJECT_DOT_1^#
}

protocol ObservableConvertibleType {
associatedtype T
}
class Observable<T> : ObservableConvertibleType {}
class CatchSequence<S: Sequence>: Observable<S.Element.T> where S.Element: ObservableConvertibleType {}

extension ObservableConvertibleType {
static func catchError() -> Observable<T> {
return CatchSequence.#^CATCHSEQUENCE_DOT^#
}
}
// CATCHSEQUENCE_DOT: Begin completions
// CATCHSEQUENCE_DOT-DAG: Keyword[self]/CurrNominal: self[#CatchSequence<_>.Type#]; name=self
// CATCHSEQUENCE_DOT-DAG: Keyword/CurrNominal: Type[#CatchSequence<_>.Type#]; name=Type
// CATCHSEQUENCE_DOT-DAG: Decl[Constructor]/CurrNominal: init()[#CatchSequence<_>#]; name=init()
// CATCHSEQUENCE_DOT-DAG: Decl[StaticMethod]/Super: catchError()[#Observable<CatchSequence<_>.T>#]; name=catchError()
// CATCHSEQUENCE_DOT-DAG: Decl[TypeAlias]/Super: T[#T#]; name=T
// CATCHSEQUENCE_DOT: End completions