mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
If the type of an `ExplicitCastExpr` is not valid, it is a null type, which causes a crash when checking if the cast type has parameterized existentials. rdar://95629905
20 lines
342 B
Swift
20 lines
342 B
Swift
// RUN: %target-typecheck-verify-swift
|
|
|
|
@resultBuilder
|
|
struct ViewBuilder {
|
|
static func buildBlock(_ x: Int) -> Int { x }
|
|
}
|
|
|
|
func test(_: () -> Void) -> Int {
|
|
return 42
|
|
}
|
|
|
|
struct MyView {
|
|
@ViewBuilder var body: Int {
|
|
test {
|
|
"ab" is Unknown // expected-error{{cannot find type 'Unknown' in scope}}
|
|
print("x")
|
|
}
|
|
}
|
|
}
|