Files
swift-mirror/validation-test/IDE/crashers_2_fixed/sr9001.swift
Rintaro Ishizaki 07172f47c3 [CodeCompletion] Don't try to resolve generic env for extension in inactive block
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
2018-10-26 10:08:51 +09:00

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