@@ -43,21 +43,6 @@ class ClosureConstraintGenerator
43
43
44
44
private:
45
45
void visitDecl (Decl *decl) {
46
- // Just ignore #if; the chosen children should appear in the
47
- // surrounding context. This isn't good for source tools but it
48
- // at least works.
49
- if (isa<IfConfigDecl>(decl))
50
- return ;
51
-
52
- // Skip #warning/#error; we'll handle them when applying the closure.
53
- if (isa<PoundDiagnosticDecl>(decl))
54
- return ;
55
-
56
- // Ignore variable declarations, because they're always handled within
57
- // their enclosing pattern bindings.
58
- if (isa<VarDecl>(decl))
59
- return ;
60
-
61
46
// Generate constraints for pattern binding declarations.
62
47
if (auto patternBinding = dyn_cast<PatternBindingDecl>(decl)) {
63
48
SolutionApplicationTarget target (patternBinding);
@@ -67,7 +52,12 @@ class ClosureConstraintGenerator
67
52
return ;
68
53
}
69
54
70
- llvm_unreachable (" Unimplemented case for closure body" );
55
+ // Ignore variable declarations, because they're always handled within
56
+ // their enclosing pattern bindings.
57
+ if (isa<VarDecl>(decl))
58
+ return ;
59
+
60
+ // Other declarations will be handled at application time.
71
61
}
72
62
73
63
void visitBraceStmt (BraceStmt *braceStmt) {
@@ -334,7 +324,14 @@ class ClosureConstraintApplication
334
324
return ;
335
325
}
336
326
337
- llvm_unreachable (" Declarations not supported" );
327
+ // Just ignore #if; the chosen children should appear in the
328
+ // surrounding context. This isn't good for source tools but it
329
+ // at least works.
330
+ if (isa<IfConfigDecl>(decl))
331
+ return ;
332
+
333
+ // Type check the declaration.
334
+ TypeChecker::typeCheckDecl (decl);
338
335
}
339
336
340
337
ASTNode visitBraceStmt (BraceStmt *braceStmt) {
0 commit comments