mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
[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:
@@ -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];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user