- Notifications
You must be signed in to change notification settings - Fork 10.5k
/
Copy pathmulti-file.swift
26 lines (19 loc) · 662 Bytes
/
multi-file.swift
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
// 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
structSomeStruct{
varvalue: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:inoutP3, y:P3){
x = y
}
func testOverrides(obj:Sub){
obj.foo()
obj.prop =5
}