mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
[IDE] Set solution-specific variable types as interface types
Setting the interface type of a variable, just to reset it to a null type is actually really gross. But quite a few methods further down in the generation of code completion results (such as USR generation) need to get a variable’s type and passing them along in a separate map would be really invasive. So this seems like the least bad solution to me.
This commit is contained in:
@@ -105,6 +105,8 @@ void ExprTypeCheckCompletionCallback::deliverResults(
|
||||
Lookup.shouldCheckForDuplicates(Results.size() > 1);
|
||||
|
||||
for (auto &Result : Results) {
|
||||
WithSolutionSpecificVarTypesRAII VarTypes(Result.SolutionSpecificVarTypes);
|
||||
|
||||
Lookup.setExpectedTypes(ExpectedTypes,
|
||||
Result.IsImplicitSingleExpressionReturn);
|
||||
Lookup.setCanCurrDeclContextHandleAsync(Result.IsInAsyncContext);
|
||||
|
||||
Reference in New Issue
Block a user