Files
swift-mirror/test/NameLookup/Inputs/multi-file-2.swift
Hamish Knight 5b99c2020f NFC: Re-organize NameBinding tests
The directory currently seems to have a mix of
tests for import resolution and name lookup.
Therefore split it into two directories;
ImportResolution and NameLookup.
2020-03-29 18:51:09 -07: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") }
}
}