mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
15 lines
561 B
Swift
15 lines
561 B
Swift
// RUN: %target-swift-frontend %s -parse -verify
|
|
|
|
// Distributed under the terms of the MIT license
|
|
// Test case submitted to project by https://github.com/practicalswift (practicalswift)
|
|
// http://www.openradar.me/18850296
|
|
|
|
func f() {
|
|
let x = 0 // expected-note {{'x' declared here}} //expected-warning {{initialization of immutable value 'x' was never used}}
|
|
class C { // expected-note {{type declared here}}
|
|
func f() {
|
|
x // expected-error {{class declaration cannot close over value 'x' defined in outer scope}}
|
|
}
|
|
}
|
|
}
|