Files
swift-mirror/test/NameBinding/Inputs/multi-file-2.swift
Chris Lattner 1a0a0315fe wordsmith a diagnostic, NFC otherwise.
Swift SVN r30731
2015-07-28 23:35:25 +00:00

35 lines
667 B
Swift

// Part of the multi-file.swift test.
import ambiguous_right
import tilde_tilde_high_precedence
class DefaultInit {
var x: DefaultInit! // = nil by default
}
func test2() {
funcOrVar = 1
var _: () -> () = funcOrVar // expected-error{{cannot convert value of type 'Int' to specified type '() -> ()'}}
_ = SomeStruct(value: 42) // use the SomeStruct from multi-file.swift
var _: Bool = true && 1 ~~ 2 && false // true && (1 ~~ 2) && false
}
func testOverriding(sub: Subclass) {
sub.method()
}
class Base {
func foo() {}
var prop: Int = 0
}
class Sub : Base {
override func foo() {}
override var prop: Int {
didSet { print("hi") }
}
}