File tree Expand file tree Collapse file tree 2 files changed +6
-3
lines changed
compiler/src/dotty/tools/dotc/typer Expand file tree Collapse file tree 2 files changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -782,7 +782,7 @@ class Namer { typer: Typer =>
782
782
783
783
protected def localContext (owner : Symbol ): FreshContext = ctx.fresh.setOwner(owner).setTree(original)
784
784
785
- var myNotNullInfos : List [NotNullInfo ] | Null = null
785
+ private var myNotNullInfos : List [NotNullInfo ] | Null = null
786
786
787
787
/** The context with which this completer was created */
788
788
given creationContext [T ]: Context =
@@ -791,6 +791,9 @@ class Namer { typer: Typer =>
791
791
// make sure testing contexts are not captured by completers
792
792
assert(! ictx.reporter.isInstanceOf [ExploringReporter ])
793
793
794
+ def setNotNullInfos (infos : List [NotNullInfo ]): Unit =
795
+ myNotNullInfos = infos
796
+
794
797
protected def typeSig (sym : Symbol ): Type = original match
795
798
case original : ValDef =>
796
799
if (sym.is(Module )) moduleValSig(sym)
Original file line number Diff line number Diff line change @@ -3297,11 +3297,11 @@ class Typer(@constructorOnly nestingLevel: Int = 0) extends Namer
3297
3297
mdef.getAttachment(SymOfTree ) match {
3298
3298
case Some (sym) => sym.infoOrCompleter match {
3299
3299
case completer : Namer # Completer =>
3300
- if ( completer.creationContext.notNullInfos ne ctx.notNullInfos)
3300
+ if completer.creationContext.notNullInfos ne ctx.notNullInfos then
3301
3301
// The RHS of a val def should know about not null facts established
3302
3302
// in preceding statements (unless the DefTree is completed ahead of time,
3303
3303
// then it is impossible).
3304
- completer.myNotNullInfos = ctx.notNullInfos
3304
+ completer.setNotNullInfos( ctx.notNullInfos)
3305
3305
true
3306
3306
case _ =>
3307
3307
// If it has been completed, then it must be because there is a forward reference
You can’t perform that action at this time.
0 commit comments