Commits

Devin Coughlin committed b07fd303150
Change ASTWalker to preserve AbstractFunctionDecl body kinds when walking. This commit changes ASTWalker to preserve AbstractFunctionDecl body kinds. When walking over an AbstractFunctionDecl, ASTWalker calls setBody() on the declaration to update the body after traversal. Prior to this commit, setBody() would unconditionally set the body kind to BodyKind::Parsed --- that is, traversing the AST would change the body kind to Parsed. In some cases, this modified a body kind from TypeChecked to Parsed, causing a small number of standard library functions to be type checked twice. This behavior also interferes with the creation of type refinement contexts for variable accessor functions (coming in a future commit). This commit adds an additional parameter to setBody() that allows callers to provide a body kind (this defaults to Parsed) and changes ASTWalker to preserve the body kind when walking a AbstractFunctionDecl. Swift SVN r22607