mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
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>.
14 lines
240 B
Swift
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()
|
|
}
|
|
}
|
|
}
|