Skip to content

Commit 0b6ab9a

Browse files
authored
Merge pull request #78400 from hamishknight/visit-loc
[AST] Walk into LocatableType in TypeWalker
2 parents f096787 + 4e33cef commit 0b6ab9a

File tree

2 files changed

+26
-1
lines changed

2 files changed

+26
-1
lines changed

lib/AST/TypeWalker.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,11 @@ class Traversal : public TypeVisitor<Traversal, bool>
5050
return false;
5151

5252
}
53-
bool visitLocatableType(LocatableType *ty) { return false; }
53+
54+
bool visitLocatableType(LocatableType *ty) {
55+
return doIt(ty->getSinglyDesugaredType());
56+
}
57+
5458
bool visitSILTokenType(SILTokenType *ty) { return false; }
5559

5660
bool visitPackType(PackType *ty) {
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
// RUN: %batch-code-completion
2+
3+
// https://github.com/apple/swift/issues/78397
4+
5+
struct TabView<Content> {
6+
public init(@ViewBuilder content: () -> Content)
7+
}
8+
9+
protocol View {}
10+
func tabItem() -> some View
11+
12+
@resultBuilder struct ViewBuilder {
13+
static func buildBlock<T>(_ content: T) -> T
14+
}
15+
16+
func test() -> some View {
17+
TabView {
18+
tabItem
19+
}#^COMPLETE^#
20+
// COMPLETE: Begin completions
21+
}

0 commit comments

Comments
 (0)