[CodeComplete] Introduce code completion expr to better preserve the context of the code completion token in ASTs.

Swift SVN r31908
This commit is contained in:
Xi Ge
2015-09-11 22:59:12 +00:00
parent 398e9233b9
commit ec4e469062
11 changed files with 55 additions and 9 deletions

View File

@@ -996,6 +996,10 @@ namespace {
return nullptr;
}
virtual Type visitCodeCompletionExpr(CodeCompletionExpr *E) {
return nullptr;
}
Type visitLiteralExpr(LiteralExpr *expr) {
// If the expression has already been assigned a type; just use that type.
if (expr->getType() && !expr->getType()->hasTypeVariable())
@@ -2755,6 +2759,10 @@ public:
return createFreeTypeVariableType(Expr);
}
Type visitCodeCompletionExpr(CodeCompletionExpr *Expr) override {
return createFreeTypeVariableType(Expr);
}
Type getResolvedType(Solution &S) {
return S.typeBindings[VT];
}