mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Fixes a crash in case a lazy var is declared after a return statement https://github.com/apple/swift/issues/73736
19 lines
422 B
Swift
19 lines
422 B
Swift
|
|
// RUN: %target-swift-emit-silgen %s | %FileCheck %s
|
|
|
|
// CHECK-LABEL: sil {{.*}} @${{.*}}3foo{{.*}}F : {{.*}} {
|
|
func foo() {
|
|
return bar(Baz())
|
|
|
|
struct Baz {
|
|
// CHECK-LABEL: sil {{.*}} @{{.*}}3foo{{.*}}3Baz{{.*}}C : {{.*}} {
|
|
init() {}
|
|
}
|
|
|
|
// CHECK-LABEL: sil {{.*}} @{{.*}}3foo{{.*}}3bar{{.*}}F : {{.*}} {
|
|
func bar(_: Any) {}
|
|
|
|
// Check that we don't crash here
|
|
lazy var v = 42
|
|
}
|