Skip to content

Commit 66f9db8

Browse files
authored
Merge pull request #38555 from hamishknight/making-new-connections-5.5
[5.5] [CS] Don't bail out of CollectVarRefs early
2 parents f11f400 + 2d965f7 commit 66f9db8

File tree

2 files changed

+48
-3
lines changed

2 files changed

+48
-3
lines changed

lib/Sema/CSGen.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2518,10 +2518,8 @@ namespace {
25182518
std::pair<bool, Expr *> walkToExprPre(Expr *expr) override {
25192519
// If there are any error expressions in this closure
25202520
// it wouldn't be possible to infer its type.
2521-
if (isa<ErrorExpr>(expr)) {
2521+
if (isa<ErrorExpr>(expr))
25222522
hasErrorExprs = true;
2523-
return {false, nullptr};
2524-
}
25252523

25262524
// Retrieve type variables from references to var decls.
25272525
if (auto *declRef = dyn_cast<DeclRefExpr>(expr)) {
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
// RUN: %swift-ide-test --code-completion --source-filename %s --code-completion-token=CC
2+
3+
struct Listing {}
4+
5+
protocol View2 {}
6+
7+
extension View2 {
8+
@available(macOS 10.15, *)
9+
func onTapGesturf(perform action: () -> Void) -> some View2 { fatalError() }
10+
}
11+
12+
@resultBuilder struct ViewBuilder2 {
13+
static func buildBlock() -> Never { fatalError() }
14+
static func buildBlock<Content>(_ content: Content) -> Content where Content : View2 { fatalError() }
15+
}
16+
17+
struct HStack2<Content> : View2 {
18+
init(@ViewBuilder2 content: () -> Content) { fatalError() }
19+
}
20+
21+
struct ItemImage2 : View2 {
22+
init(path: String) {}
23+
}
24+
25+
struct ForEach2<Data, Content>: View2 {
26+
init(_ data: [Listing], @ViewBuilder2 content: (Data) -> Content) {}
27+
}
28+
29+
30+
struct TodayNookazonSection {
31+
32+
let listings: [Listing]
33+
34+
@available(macOS 10.15, *)
35+
@ViewBuilder2 var body: some View2 {
36+
ForEach2(listings) { listing in
37+
HStack2 {
38+
HStack2 {
39+
ItemImage2(path#^CC^#: "abc")
40+
}
41+
.onTapGesturf {
42+
listing
43+
}
44+
}
45+
}
46+
}
47+
}

0 commit comments

Comments
 (0)