Skip to content

Commit 87eb38f

Browse files
authored
Merge pull request #27938 from hborla/file-literal-test
[Test] Add a regression test for invalid/empty file literals.
2 parents 55f9d2a + 13de788 commit 87eb38f

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

test/Sema/object_literals_osx.swift

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,3 +24,6 @@ let p1: Path = #fileLiteral(resourceName: "what.txt")
2424
let p2 = #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}}
2525

2626
let text = #fileLiteral(resourceName: "TextFile.txt").relativeString! // expected-error{{type of expression is ambiguous without more context}}
27+
28+
// rdar://problem/49861813
29+
#fileLiteral() // expected-error {{cannot convert value of type '()' to expected argument type '(resourceName: String)'}}

0 commit comments

Comments
 (0)