mirror of
https://github.com/apple/swift.git
synced 2026-03-04 18:24:35 +01:00
Introduce 'TypeCheckSingleASTNode' mode that only type checks single body element and dependent necessities (i.e. referencing ValueDecls and their dependencies). Renamed swift::typeCheckAbstractFunctionBodyAtLoc() to swift::typeCheckASTNodeAtLoc(DeclContext *, SourceLoc). That type checks innermost 'ASTNode' at the location. Also, 'TypeCheckSingleASTNode' mode skips type checking any "body" of the node (i.e. BraceStmt elements for function body, if statement body, closure body, etc.) Added on-demand type checking using it: - VarDecl in TapExpr - ParamDecl in ClosureExpr - Return type of ClosureExpr - Binding value in control statements (e.g. ForEachStmt, SwitchStmt, DoCatchStmt, etc.) rdar://problem/63932852