1
1
package dotty .tools .backend .jvm
2
2
3
- import scala .language .unsafeNulls
3
+ // import scala.language.unsafeNulls
4
4
5
5
import dotty .tools .dotc .ast .tpd
6
6
import dotty .tools .dotc .core .Flags .*
@@ -44,14 +44,14 @@ class DottyBackendInterface(val superCallsMap: ReadOnlyMap[Symbol, List[ClassSym
44
44
45
45
object DesugaredSelect extends DeconstructorCommon [tpd.Tree ] {
46
46
47
- var desugared : tpd.Select = null
47
+ var desugared : tpd.Select | Null = null
48
48
49
49
override def isEmpty : Boolean =
50
50
desugared eq null
51
51
52
- def _1 : Tree = desugared.qualifier
52
+ def _1 : Tree = desugared.nn. qualifier
53
53
54
- def _2 : Name = desugared.name
54
+ def _2 : Name = desugared.nn. name
55
55
56
56
override def unapply (s : tpd.Tree ): this .type = {
57
57
s match {
@@ -69,17 +69,17 @@ class DottyBackendInterface(val superCallsMap: ReadOnlyMap[Symbol, List[ClassSym
69
69
}
70
70
71
71
object ArrayValue extends DeconstructorCommon [tpd.JavaSeqLiteral ] {
72
- def _1 : Type = field.tpe match {
72
+ def _1 : Type = field.nn. tpe match {
73
73
case JavaArrayType (elem) => elem
74
74
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))
76
76
UnspecifiedErrorType
77
77
}
78
- def _2 : List [Tree ] = field.elems
78
+ def _2 : List [Tree ] = field.nn. elems
79
79
}
80
80
81
- abstract class DeconstructorCommon [T >: Null <: AnyRef ] {
82
- var field : T = null
81
+ abstract class DeconstructorCommon [T <: AnyRef ] {
82
+ var field : T | Null = null
83
83
def get : this .type = this
84
84
def isEmpty : Boolean = field eq null
85
85
def isDefined = ! isEmpty
0 commit comments