Files
swift-mirror/validation-test/compiler_crashers_2_fixed/rdar95629905.swift
Alex Hoppen 28a8e0762d [TypeChecker] Don’t crash if a ExplicitCastExpr doesn’t have a cast type
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
2022-06-27 17:21:53 +02:00

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")
}
}
}