File tree Expand file tree Collapse file tree 4 files changed +6
-7
lines changed
compiler/src/dotty/tools/dotc Expand file tree Collapse file tree 4 files changed +6
-7
lines changed Original file line number Diff line number Diff line change @@ -274,9 +274,7 @@ object Contexts {
274274 def effectiveScope (using Context ): Scope =
275275 val co : Symbol | Null = owner
276276 if co != null && co.isClass then co.asClass.unforcedDecls
277- else
278- val s : Scope | Null = scope
279- if s == null then EmptyScope else s
277+ else scope
280278
281279 def nestingLevel : Int = effectiveScope.nestingLevel
282280
@@ -828,6 +826,7 @@ object Contexts {
828826 owner = NoSymbol
829827 tree = untpd.EmptyTree
830828 moreProperties = Map (MessageLimiter -> DefaultMessageLimiter ())
829+ scope = EmptyScope
831830 source = NoSource
832831 store = initialStore
833832 .updated(settingsStateLoc, settingsGroup.defaultState)
Original file line number Diff line number Diff line change @@ -1237,7 +1237,7 @@ object SymDenotations {
12371237 .map(tpd.definedSym)
12381238 .find(_.name == name)
12391239 .getOrElse(NoSymbol )
1240- else if (( ctx.scope: Scope | Null ) == null ) // TODO
1240+ else if (ctx.scope eq EmptyScope )
12411241 NoSymbol
12421242 else if (ctx.scope.lookup(this .name) == symbol)
12431243 ctx.scope.lookup(name)
Original file line number Diff line number Diff line change @@ -11,6 +11,7 @@ import dotty.tools.dotc.core.Flags._
1111import dotty .tools .dotc .core .Names .{Name , TermName }
1212import dotty .tools .dotc .core .NameKinds .SimpleNameKind
1313import dotty .tools .dotc .core .NameOps ._
14+ import dotty .tools .dotc .core .Scopes ._
1415import dotty .tools .dotc .core .Symbols .{Symbol , defn }
1516import dotty .tools .dotc .core .StdNames .nme
1617import dotty .tools .dotc .core .SymDenotations .SymDenotation
@@ -185,7 +186,7 @@ object Completion {
185186 .groupByName.foreach { (name, denots) =>
186187 addMapping(name, ScopedDenotations (denots, ctx))
187188 }
188- else if ctx.scope != null then
189+ else if ctx.scope ne EmptyScope then
189190 ctx.scope.toList.filter(symbol => include(symbol, symbol.name))
190191 .flatMap(_.alternatives)
191192 .groupByName.foreach { (name, denots) =>
Original file line number Diff line number Diff line change @@ -324,8 +324,7 @@ class Typer(@constructorOnly nestingLevel: Int = 0) extends Namer
324324 (prevPrec.ordinal < prec.ordinal || prevPrec == prec && (prevCtx.scope eq ctx.scope))
325325
326326 @ tailrec def loop (lastCtx : Context )(using Context ): Type =
327- // Can ctx.scope actually be null?
328- if ((ctx.scope: Scope | Null ) == null ) previous
327+ if (ctx.scope eq EmptyScope ) previous
329328 else {
330329 var result : Type = NoType
331330
You can’t perform that action at this time.
0 commit comments