11package dotty .tools .backend .jvm
22
3- import scala .language .unsafeNulls
43
54import dotty .tools .dotc .ast .tpd
65import dotty .tools .dotc .core .Flags .*
@@ -44,14 +43,14 @@ class DottyBackendInterface(val superCallsMap: ReadOnlyMap[Symbol, List[ClassSym
4443
4544 object DesugaredSelect extends DeconstructorCommon [tpd.Tree ] {
4645
47- var desugared : tpd.Select = null
46+ var desugared : tpd.Select | Null = null
4847
4948 override def isEmpty : Boolean =
5049 desugared eq null
5150
52- def _1 : Tree = desugared.qualifier
51+ def _1 : Tree = desugared.nn. qualifier
5352
54- def _2 : Name = desugared.name
53+ def _2 : Name = desugared.nn. name
5554
5655 override def unapply (s : tpd.Tree ): this .type = {
5756 s match {
@@ -69,17 +68,17 @@ class DottyBackendInterface(val superCallsMap: ReadOnlyMap[Symbol, List[ClassSym
6968 }
7069
7170 object ArrayValue extends DeconstructorCommon [tpd.JavaSeqLiteral ] {
72- def _1 : Type = field.tpe match {
71+ def _1 : Type = field.nn. tpe match {
7372 case JavaArrayType (elem) => elem
7473 case _ =>
75- report.error(em " JavaSeqArray with type ${field.tpe} reached backend: $field" , ctx.source.atSpan(field.span))
74+ report.error(em " JavaSeqArray with type ${field.nn. tpe} reached backend: $field" , ctx.source.atSpan(field.nn .span))
7675 UnspecifiedErrorType
7776 }
78- def _2 : List [Tree ] = field.elems
77+ def _2 : List [Tree ] = field.nn. elems
7978 }
8079
81- abstract class DeconstructorCommon [T >: Null <: AnyRef ] {
82- var field : T = null
80+ abstract class DeconstructorCommon [T <: AnyRef ] {
81+ var field : T | Null = null
8382 def get : this .type = this
8483 def isEmpty : Boolean = field eq null
8584 def isDefined = ! isEmpty
0 commit comments