Skip to content

Commit eadffd3

Browse files
committed
AST: Don't look at PatternBindingDecl in usesBuiltinType()
Type-checking patterns is not fully requestified, so the ASTPrinter should not assume this has been filled in. It appears sufficient to just visit the associated VarDecl, as we do already.
1 parent 010415f commit eadffd3

File tree

2 files changed

+4
-9
lines changed

2 files changed

+4
-9
lines changed

lib/AST/ASTPrinter.cpp

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3041,14 +3041,6 @@ static bool usesBuiltinType(Decl *decl, BuiltinTypeKind kind) {
30413041
}
30423042
}
30433043

3044-
if (auto patternBinding = dyn_cast<PatternBindingDecl>(decl)) {
3045-
for (unsigned idx : range(patternBinding->getNumPatternEntries())) {
3046-
if (Type type = patternBinding->getPattern(idx)->getType())
3047-
if (typeMatches(type))
3048-
return true;
3049-
}
3050-
}
3051-
30523044
return false;
30533045
}
30543046

test/ModuleInterface/resolve-imports.swift

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,7 @@ public class C {}
1919

2020
// CHECK: public class C {
2121
// CHECK: deinit
22-
// CHECK: }
22+
// CHECK: }
23+
24+
// Globals
25+
public var year = 2023

0 commit comments

Comments
 (0)