Skip to content

Commit bf4bea8

Browse files
authored
Merge pull request #3028 from augusto2112/test-existential-types
[lldb] Add test for existential types on the REPL
2 parents 03daa39 + e21e374 commit bf4bea8

File tree

1 file changed

+41
-0
lines changed

1 file changed

+41
-0
lines changed
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
2+
// Test that the we can resolve the dynamic type of existential correctly.
3+
// REQUIRES: swift
4+
5+
// RUN: %lldb --repl < %s | FileCheck %s
6+
7+
protocol A {}
8+
9+
class B: A {}
10+
11+
struct C: A {}
12+
13+
enum D: A {
14+
case empty
15+
}
16+
17+
class E: Error, A {}
18+
19+
struct F: Error, A {}
20+
21+
enum G: Error, A {
22+
case empty
23+
}
24+
25+
let b: A = B()
26+
// CHECK: {{b}}: B = {}
27+
28+
let c: A = C()
29+
// CHECK: {{c}}: C = {}
30+
31+
let d: A = D.empty
32+
// CHECK: {{d}}: D = empty
33+
34+
let e: A = E()
35+
// CHECK: {{e}}: E = {}
36+
37+
let f: A = F()
38+
// CHECK: {{f}}: F = {}
39+
40+
let g: A = G.empty
41+
// CHECK: {{g}}: G = empty

0 commit comments

Comments
 (0)