mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Fixes code-completion crash in validateExtension(). When code completion happens, it tries to validate decl contexts. If it's in an extension in inactivec conditional block, the extension haven't been bound to nominal type. That used to cause crash because its GenericParams hasn't been set. rdar://problem/45275782 https://bugs.swift.org/browse/SR-9001
21 lines
411 B
Swift
21 lines
411 B
Swift
// RUN: %target-swift-ide-test -code-completion -code-completion-token=COMPLETE_1 -source-filename=%s
|
|
// RUN: %target-swift-ide-test -code-completion -code-completion-token=COMPLETE_2 -source-filename=%s
|
|
|
|
struct MyStruct<T> {
|
|
}
|
|
|
|
protocol MyProto {
|
|
associatedtype Assoc
|
|
func foo(x: Assoc) -> Assoc
|
|
}
|
|
|
|
#if false
|
|
extension MyStruct {
|
|
#^COMPLETE_1^#
|
|
}
|
|
|
|
extension MyStruct: MyProto {
|
|
#^COMPLETE_2^#
|
|
}
|
|
#endif
|