From ed14fbf5f7f74094db1b6f5efec08290b081b142 Mon Sep 17 00:00:00 2001 From: odersky Date: Fri, 18 Nov 2022 10:41:33 +0100 Subject: [PATCH] Compute completions at typerPhase Fixes #16360 --- compiler/src/dotty/tools/dotc/interactive/Completion.scala | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/compiler/src/dotty/tools/dotc/interactive/Completion.scala b/compiler/src/dotty/tools/dotc/interactive/Completion.scala index 414d406e870a..8ccdaae41371 100644 --- a/compiler/src/dotty/tools/dotc/interactive/Completion.scala +++ b/compiler/src/dotty/tools/dotc/interactive/Completion.scala @@ -16,6 +16,7 @@ import dotty.tools.dotc.core.Symbols.{NoSymbol, Symbol, defn, newSymbol} import dotty.tools.dotc.core.StdNames.nme import dotty.tools.dotc.core.SymDenotations.SymDenotation import dotty.tools.dotc.core.TypeError +import dotty.tools.dotc.core.Phases import dotty.tools.dotc.core.Types.{AppliedType, ExprType, MethodOrPoly, NameFilter, NoType, RefinedType, TermRef, Type, TypeProxy} import dotty.tools.dotc.parsing.Tokens import dotty.tools.dotc.util.Chars @@ -45,7 +46,7 @@ object Completion { */ def completions(pos: SourcePosition)(using Context): (Int, List[Completion]) = { val path = Interactive.pathTo(ctx.compilationUnit.tpdTree, pos.span) - computeCompletions(pos, path)(using Interactive.contextOfPath(path)) + computeCompletions(pos, path)(using Interactive.contextOfPath(path).withPhase(Phases.typerPhase)) } /**