File tree 2 files changed +6
-3
lines changed
compiler/src/dotty/tools/dotc/typer
2 files changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -785,7 +785,7 @@ class Namer { typer: Typer =>
785
785
786
786
protected def localContext (owner : Symbol ): FreshContext = ctx.fresh.setOwner(owner).setTree(original)
787
787
788
- var myNotNullInfos : List [NotNullInfo ] | Null = null
788
+ private var myNotNullInfos : List [NotNullInfo ] | Null = null
789
789
790
790
/** The context with which this completer was created */
791
791
given creationContext [T ]: Context =
@@ -794,6 +794,9 @@ class Namer { typer: Typer =>
794
794
// make sure testing contexts are not captured by completers
795
795
assert(! ictx.reporter.isInstanceOf [ExploringReporter ])
796
796
797
+ def setNotNullInfos (infos : List [NotNullInfo ]): Unit =
798
+ myNotNullInfos = infos
799
+
797
800
protected def typeSig (sym : Symbol ): Type = original match
798
801
case original : ValDef =>
799
802
if (sym.is(Module )) moduleValSig(sym)
Original file line number Diff line number Diff line change @@ -3361,11 +3361,11 @@ class Typer(@constructorOnly nestingLevel: Int = 0) extends Namer
3361
3361
mdef.getAttachment(SymOfTree ) match {
3362
3362
case Some (sym) => sym.infoOrCompleter match {
3363
3363
case completer : Namer # Completer =>
3364
- if ( completer.creationContext.notNullInfos ne ctx.notNullInfos)
3364
+ if completer.creationContext.notNullInfos ne ctx.notNullInfos then
3365
3365
// The RHS of a val def should know about not null facts established
3366
3366
// in preceding statements (unless the DefTree is completed ahead of time,
3367
3367
// then it is impossible).
3368
- completer.myNotNullInfos = ctx.notNullInfos
3368
+ completer.setNotNullInfos( ctx.notNullInfos)
3369
3369
true
3370
3370
case _ =>
3371
3371
// 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