11package dotty .tools .backend .jvm
22
3- import scala .language .unsafeNulls
3+ // import scala.language.unsafeNulls
44
55import dotty .tools .dotc .ast .tpd
66import dotty .tools .dotc .core .Flags .*
@@ -44,14 +44,14 @@ class DottyBackendInterface(val superCallsMap: ReadOnlyMap[Symbol, List[ClassSym
4444
4545 object DesugaredSelect extends DeconstructorCommon [tpd.Tree ] {
4646
47- var desugared : tpd.Select = null
47+ var desugared : tpd.Select | Null = null
4848
4949 override def isEmpty : Boolean =
5050 desugared eq null
5151
52- def _1 : Tree = desugared.qualifier
52+ def _1 : Tree = desugared.nn. qualifier
5353
54- def _2 : Name = desugared.name
54+ def _2 : Name = desugared.nn. name
5555
5656 override def unapply (s : tpd.Tree ): this .type = {
5757 s match {
@@ -69,17 +69,17 @@ class DottyBackendInterface(val superCallsMap: ReadOnlyMap[Symbol, List[ClassSym
6969 }
7070
7171 object ArrayValue extends DeconstructorCommon [tpd.JavaSeqLiteral ] {
72- def _1 : Type = field.tpe match {
72+ def _1 : Type = field.nn. tpe match {
7373 case JavaArrayType (elem) => elem
7474 case _ =>
75- report.error(em " JavaSeqArray with type ${field.tpe} reached backend: $field" , ctx.source.atSpan(field.span))
75+ report.error(em " JavaSeqArray with type ${field.nn. tpe} reached backend: $field" , ctx.source.atSpan(field.nn .span))
7676 UnspecifiedErrorType
7777 }
78- def _2 : List [Tree ] = field.elems
78+ def _2 : List [Tree ] = field.nn. elems
7979 }
8080
81- abstract class DeconstructorCommon [T >: Null <: AnyRef ] {
82- var field : T = null
81+ abstract class DeconstructorCommon [T <: AnyRef ] {
82+ var field : T | Null = null
8383 def get : this .type = this
8484 def isEmpty : Boolean = field eq null
8585 def isDefined = ! isEmpty
0 commit comments