Open
Description
The following crashes the compiler (in fact it crashes so hard you don't get a backtrace):
@dynamicMemberLookup
struct S<T> {
subscript<U>(dynamicMember keyPath: KeyPath<S<U>, U>) -> U {
fatalError()
}
}
func foo(_ x: S<Int>) {
x.y
}
Stack dump:
0. Program arguments: ./swift -frontend -typecheck /Users/hamish/src/swift-test-arena/main.swift -sdk /Users/hamish/src/MacOSX.sdk -debug-diagnostic-names -diagnostic-style=llvm
1. Swift version 6.1-dev (LLVM 93a0c7d99e811a4, Swift 0234f7ab4a3003b)
2. Compiling with effective version 5.10
3. While evaluating request TypeCheckSourceFileRequest(source_file "/Users/hamish/src/swift-test-arena/main.swift")
4. While evaluating request TypeCheckFunctionBodyRequest(main.(file).foo@/Users/hamish/src/swift-test-arena/main.swift:615:6)
5. While type-checking statement at [/Users/hamish/src/swift-test-arena/main.swift:615:23 - line:617:1] RangeText="{
x.y
"
6. While type-checking expression at [/Users/hamish/src/swift-test-arena/main.swift:616:3 - line:616:5] RangeText="x."
7. While type-checking-target starting at /Users/hamish/src/swift-test-arena/main.swift:616:5
fish: Job 1, './swift -frontend -typecheck ~/…' terminated by signal SIGSEGV (Address boundary error)