mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
14 lines
311 B
Swift
14 lines
311 B
Swift
// RUN: %target-typecheck-verify-swift
|
|
|
|
func frob(x: inout Int) {}
|
|
|
|
func foo() {
|
|
let x: Int // expected-note* {{}}
|
|
|
|
x = 0
|
|
|
|
_ = { frob(x: x) }() // expected-error{{'x' is a 'let'}}
|
|
_ = { x = 0 }() // expected-error{{'x' is a 'let'}}
|
|
_ = { frob(x: x); x = 0 }() // expected-error 2 {{'x' is a 'let'}}
|
|
}
|