Files
swift-mirror/test/NameLookup/multi-file.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

27 lines
662 B
Swift

// RUN: %target-swift-frontend -typecheck -parse-as-library -enable-source-import %s %S/Inputs/multi-file-2.swift %S/Inputs/multi-file-3.swift -module-name MultiFile -I %S/Inputs -sdk "" -verify
import ambiguous_left
import tilde_tilde_low_precedence
struct SomeStruct {
var value: Int
}
func test() {
funcOrVar()
var _: Int = funcOrVar // expected-error{{cannot convert value of type '() -> ()' to specified type 'Int'}}
_ = SomeStruct(value: 42) // use the local SomeStruct
var _: Bool = 1 + 2 ~~ 3 + 4 // (1 + 2) ~~ (3 + 4)
}
func conformsToItself(x: inout P3, y: P3) {
x = y
}
func testOverrides(obj: Sub) {
obj.foo()
obj.prop = 5
}