Skip to content

Commit f652a9d

Browse files
authored
Merge pull request #42295 from ahoppen/pr/add-fixed-test-cases
[IDE][Sema] Add test cases for issues no longer occurring in the stress tester
2 parents e59c6c1 + e0205f7 commit f652a9d

File tree

2 files changed

+46
-0
lines changed

2 files changed

+46
-0
lines changed
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
// RUN: %target-swift-ide-test --code-completion --source-filename %s --code-completion-token=COMPLETE | %FileCheck %s
2+
3+
protocol View2 {}
4+
5+
extension Never : View2 {}
6+
7+
struct Text2: View2 {}
8+
9+
@resultBuilder struct ViewBuilder2 {
10+
static func buildBlock() -> Never { fatalError() }
11+
static func buildBlock<Content>(_ content: Content) -> Content where Content : View2 { fatalError() }
12+
}
13+
14+
struct MysteryIsland2 {
15+
let chance: Int = 2
16+
}
17+
18+
struct VStack2<Content> : View2 where Content : View2 {
19+
init(@ViewBuilder2 content: () -> Content) { fatalError() }
20+
}
21+
22+
struct MysteryIslandDetail {
23+
let island: MysteryIsland2
24+
25+
@ViewBuilder2 var body: some View2 {
26+
let b = "\(island.#^COMPLETE^#chance)"
27+
VStack2() {}
28+
}
29+
}
30+
31+
// CHECK: Begin completions, 2 items
32+
// CHECK-DAG: Keyword[self]/CurrNominal: self[#MysteryIsland2#]; name=self
33+
// CHECK-DAG: Decl[InstanceVar]/CurrNominal/TypeRelation[Convertible]: chance[#Int#]; name=chance
34+
// CHECK: End completions
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
// RUN: not %target-swift-frontend -typecheck %s
2+
3+
public struct {
4+
@UserDefault()
5+
public static var region: String
6+
}
7+
8+
@propertyWrapper
9+
public struct UserDefault {
10+
init() {}
11+
public var wrappedValue: String
12+
}

0 commit comments

Comments
 (0)