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