Files
swift-mirror/validation-test/compiler_crashers_2_fixed/rdar58813746.swift
Slava Pestov 769c4c1911 Sema: Fix some crashes with invalid nesting of extensions and protocols
Make sure we consistently use getParentForLookup() and not getParent()
when looking at generic DeclContexts. This is because an extension or
protocol that is nested inside of another generic context must never
inherit generic parameters from the parent context.

We already had this invariant enforced in some places, but now that we
do it more consistently we can fix more crashes of this kind.

Fixes <rdar://problem/58813746>, <https://bugs.swift.org/browse/SR-13004>.
2020-07-28 02:07:16 -04:00

14 lines
240 B
Swift

// RUN: not %target-swift-frontend -typecheck %s
struct CommandContext<Command> {
init() {
let input = [1,2,3].filter {
extension CommandContext {
struct Options {
subscript<T>(path: T) -> Int {
fatalError()
}
}
}