Parse default-argument expressions in an initializer context.

Swift SVN r11178
This commit is contained in:
John McCall
2013-12-12 03:36:27 +00:00
parent c755c99255
commit 342a8b35db
15 changed files with 458 additions and 131 deletions

View File

@@ -651,7 +651,11 @@ class CodeCompletionCallbacksImpl : public CodeCompletionCallbacks {
return typeCheckCompletionDecl(cast<NominalTypeDecl>(DC));
}
if (DC->getContextKind() == DeclContextKind::TopLevelCodeDecl) {
return typeCheckTopLevelCodeDecl(dyn_cast<TopLevelCodeDecl>(DC));
// Code completion can see top-level code declarations that
// haven't been filled in properly.
auto code = cast<TopLevelCodeDecl>(DC);
if (!code->getBody()) return true;
return typeCheckTopLevelCodeDecl(code);
}
return true;
}