Skip to content

Commit fb9d8d8

Browse files
committed
[Clang importer] more swift_newtype testing
A test case to make sure name lookup succeeds for swift_newtype.
1 parent 476f92d commit fb9d8d8

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

test/IDE/newtype.swift

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,3 +31,23 @@
3131
// PRINT-NEXT: static let secondEntry: ClosedEnum
3232
// PRINT-NEXT: static let thirdEntry: ClosedEnum
3333
// PRINT-NEXT: }
34+
35+
// RUN: %target-parse-verify-swift -I %S/Inputs/custom-modules
36+
import Newtype
37+
38+
func tests() {
39+
let errOne = ErrorDomain.one
40+
errOne.process()
41+
42+
let fooErr = Foo.err
43+
fooErr.process()
44+
Foo().process() // expected-error{{value of type 'Foo' has no member 'process'}}
45+
46+
let thirdEnum = ClosedEnum.thirdEntry
47+
thirdEnum.process()
48+
// expected-error@-1{{value of type 'ClosedEnum' has no member 'process'}}
49+
50+
let _ = ErrorDomain(rawValue: thirdEnum.rawValue)
51+
let _ = ClosedEnum(rawValue: errOne.rawValue)
52+
53+
}

0 commit comments

Comments
 (0)