Skip to content

Commit dbdbbff

Browse files
committed
SILParser: Overhaul to not rely on parse-time lookup
1 parent 8f7c59e commit dbdbbff

File tree

5 files changed

+257
-224
lines changed

5 files changed

+257
-224
lines changed

include/swift/Subsystems.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,9 @@ namespace swift {
149149
///
150150
/// \returns A well-formed type on success, or an \c ErrorType.
151151
Type performTypeResolution(TypeRepr *TyR, ASTContext &Ctx, bool isSILMode,
152-
bool isSILType, GenericEnvironment *GenericEnv,
152+
bool isSILType,
153+
GenericEnvironment *GenericEnv,
154+
GenericParamList *GenericParams,
153155
DeclContext *DC, bool ProduceDiagnostics = true);
154156

155157
/// Expose TypeChecker's handling of GenericParamList to SIL parsing.

lib/IDE/CodeCompletion.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1617,7 +1617,9 @@ class CodeCompletionCallbacksImpl : public CodeCompletionCallbacks {
16171617
const auto ty = swift::performTypeResolution(
16181618
ParsedTypeLoc.getTypeRepr(), P.Context,
16191619
/*isSILMode=*/false,
1620-
/*isSILType=*/false, CurDeclContext->getGenericEnvironmentOfContext(),
1620+
/*isSILType=*/false,
1621+
CurDeclContext->getGenericEnvironmentOfContext(),
1622+
/*GenericParams=*/nullptr,
16211623
CurDeclContext,
16221624
/*ProduceDiagnostics=*/false);
16231625
ParsedTypeLoc.setType(ty);

lib/IDE/ExprContextAnalysis.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -336,7 +336,7 @@ void swift::ide::collectPossibleReturnTypesFromContext(
336336
const auto type = swift::performTypeResolution(
337337
CE->getExplicitResultTypeRepr(), DC->getASTContext(),
338338
/*isSILMode=*/false, /*isSILType=*/false,
339-
DC->getGenericEnvironmentOfContext(),
339+
DC->getGenericEnvironmentOfContext(), /*GenericParams=*/nullptr,
340340
const_cast<DeclContext *>(DC), /*diagnostics=*/false);
341341

342342
if (!type->hasError()) {

0 commit comments

Comments
 (0)