Skip to content

Commit 9758499

Browse files
committed
[Type checker] Teach performTypeLocChecking() to provide a generic environment.
This routine was passing a 'null' generic environment when it should, in fact, provide the generic environment for its context. Fixes a code-completion regression introduced by the removal of PartialGenericTypeToArchetypeResolver.
1 parent 6c7277b commit 9758499

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

lib/Sema/TypeChecker.cpp

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -693,11 +693,12 @@ void swift::performWholeModuleTypeChecking(SourceFile &SF) {
693693
bool swift::performTypeLocChecking(ASTContext &Ctx, TypeLoc &T,
694694
DeclContext *DC,
695695
bool ProduceDiagnostics) {
696-
return performTypeLocChecking(Ctx, T,
697-
/*isSILMode=*/false,
698-
/*isSILType=*/false,
699-
/*GenericEnv=*/nullptr,
700-
DC, ProduceDiagnostics);
696+
return performTypeLocChecking(
697+
Ctx, T,
698+
/*isSILMode=*/false,
699+
/*isSILType=*/false,
700+
/*GenericEnv=*/DC->getGenericEnvironmentOfContext(),
701+
DC, ProduceDiagnostics);
701702
}
702703

703704
bool swift::performTypeLocChecking(ASTContext &Ctx, TypeLoc &T,

0 commit comments

Comments
 (0)