mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
The menu item should be capitalised, and it's nicer if the fatalError is on its own line in the new function body.
75 lines
826 B
Plaintext
75 lines
826 B
Plaintext
var foo: Int = 0
|
|
|
|
var bar: Int {
|
|
return 0
|
|
}
|
|
|
|
var qux: Int = 0 {
|
|
willSet {
|
|
fatalError()
|
|
}
|
|
didSet {
|
|
fatalError()
|
|
}
|
|
}
|
|
|
|
func generic<T>(_: T) -> Int {
|
|
return 0
|
|
}
|
|
|
|
class Foo {
|
|
var foo: Int
|
|
|
|
var bar: Int {
|
|
return 0
|
|
}
|
|
|
|
var baz: Int {
|
|
get { return 0 }
|
|
set { foo = newValue }
|
|
}
|
|
|
|
var qux: Int {
|
|
willSet { print("hi") }
|
|
didSet { print("bye") }
|
|
}
|
|
|
|
init() {
|
|
foo = 0
|
|
qux = 1
|
|
}
|
|
|
|
func nonGeneric() -> Int {
|
|
return 0
|
|
}
|
|
|
|
func generic<T>(_: T) -> Int {
|
|
return 0
|
|
}
|
|
|
|
deinit {
|
|
print("bye")
|
|
}
|
|
}
|
|
|
|
extension Foo {
|
|
func nonGeneric2() -> Int {
|
|
return 0
|
|
}
|
|
|
|
func generic2<T>(_: T) -> Int {
|
|
return 0
|
|
}
|
|
}
|
|
|
|
|
|
// FIXME: we should be able to run on the whole file.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|