You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
lety2= #colorLiteral(red:1, green:0, blue:0, alpha:1) // expected-error{{could not infer type of color literal}} expected-note{{import UIKit to use 'UIColor' as the default color literal type}}
9
+
lety2= #colorLiteral(red:1, green:0, blue:0, alpha:1) // expected-error{{could not infer type of color literal}}
10
+
// expected-note@-1{{import UIKit to use 'UIColor' as the default color literal type}}
// expected-error@-1 {{could not infer type of color literal}} expected-note@-1 {{import UIKit to use 'UIColor' as the default color literal type}}
12
+
// expected-error@-1 {{could not infer type of color literal}}
13
+
// expected-note@-2 {{import UIKit to use 'UIColor' as the default color literal type}}
12
14
13
15
structI:_ExpressibleByImageLiteral{
14
16
init(imageLiteralResourceName:String){}
15
17
}
16
18
17
19
letz:I= #imageLiteral(resourceName:"hello.png")
18
-
letz2= #imageLiteral(resourceName:"hello.png") // expected-error{{could not infer type of image literal}} expected-note{{import UIKit to use 'UIImage' as the default image literal type}}
20
+
letz2= #imageLiteral(resourceName:"hello.png") // expected-error{{could not infer type of image literal}}
21
+
// expected-note@-1{{import UIKit to use 'UIImage' as the default image literal type}}
19
22
20
23
structPath:_ExpressibleByFileReferenceLiteral{
21
24
init(fileReferenceLiteralResourceName:String){}
22
25
}
23
26
24
27
letp1:Path= #fileLiteral(resourceName:"what.txt")
25
-
letp2= #fileLiteral(resourceName:"what.txt") // expected-error{{could not infer type of file reference literal}} expected-note{{import Foundation to use 'URL' as the default file reference literal type}}
28
+
letp2= #fileLiteral(resourceName:"what.txt") // expected-error{{could not infer type of file reference literal}}
29
+
// expected-note@-1{{import Foundation to use 'URL' as the default file reference literal type}}
lety2= #colorLiteral(red:1, green:0, blue:0, alpha:1) // expected-error{{could not infer type of color literal}} expected-note{{import AppKit to use 'NSColor' as the default color literal type}}
10
-
lety3= #colorLiteral(red:1, bleen:0, grue:0, alpha:1) // expected-error{{incorrect argument labels in call (have 'red:bleen:grue:alpha:', expected 'red:green:blue:alpha:')}} expected-error{{could not infer type of color literal}} expected-note{{import AppKit to use 'NSColor' as the default color literal type}}
9
+
lety2= #colorLiteral(red:1, green:0, blue:0, alpha:1) // expected-error{{could not infer type of color literal}}
10
+
// expected-note@-1{{import AppKit to use 'NSColor' as the default color literal type}}
// expected-error@-1{{could not infer type of color literal}}
13
+
// expected-note@-2{{import AppKit to use 'NSColor' as the default color literal type}}
11
14
12
15
structI:_ExpressibleByImageLiteral{
13
16
init(imageLiteralResourceName:String){}
14
17
}
15
18
16
19
letz:I= #imageLiteral(resourceName:"hello.png")
17
-
letz2= #imageLiteral(resourceName:"hello.png") // expected-error{{could not infer type of image literal}} expected-note{{import AppKit to use 'NSImage' as the default image literal type}}
20
+
letz2= #imageLiteral(resourceName:"hello.png") // expected-error{{could not infer type of image literal}}
21
+
// expected-note@-1{{import AppKit to use 'NSImage' as the default image literal type}}
18
22
19
23
structPath:_ExpressibleByFileReferenceLiteral{
20
24
init(fileReferenceLiteralResourceName:String){}
21
25
}
22
26
23
27
letp1:Path= #fileLiteral(resourceName:"what.txt")
24
-
letp2= #fileLiteral(resourceName:"what.txt") // expected-error{{could not infer type of file reference literal}} expected-note{{import Foundation to use 'URL' as the default file reference literal type}}
28
+
letp2= #fileLiteral(resourceName:"what.txt") // expected-error{{could not infer type of file reference literal}}
29
+
// expected-note@-1{{import Foundation to use 'URL' as the default file reference literal type}}
25
30
26
-
lettext= #fileLiteral(resourceName:"TextFile.txt").relativeString! // expected-error{{could not infer type of file reference literal}} expected-note{{import Foundation to use 'URL' as the default file reference literal type}}
31
+
lettext= #fileLiteral(resourceName:"TextFile.txt").relativeString! // expected-error{{could not infer type of file reference literal}}
32
+
// expected-note@-1{{import Foundation to use 'URL' as the default file reference literal type}}
27
33
28
34
// rdar://problem/49861813
29
-
#fileLiteral() // expected-error{{missing argument for parameter 'resourceName' in call}} expected-error{{could not infer type of file reference literal}} expected-note{{import Foundation to use 'URL' as the default file reference literal type}}
35
+
#fileLiteral() // expected-error{{missing argument for parameter 'resourceName' in call}}
36
+
// expected-error@-1{{could not infer type of file reference literal}}
37
+
// expected-note@-2{{import Foundation to use 'URL' as the default file reference literal type}}
0 commit comments