Skip to content

Commit 4d44127

Browse files
committed
Migrate transform
1 parent 971de45 commit 4d44127

File tree

104 files changed

+268
-63
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

104 files changed

+268
-63
lines changed

compiler/src/dotty/tools/dotc/core/ContextOps.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ object ContextOps:
3232
if (ctx.owner.isClass)
3333
if (ctx.outer.owner == ctx.owner) { // inner class scope; check whether we are referring to self
3434
if (ctx.scope.size == 1) {
35-
val elem = ctx.scope.lastEntry
35+
val elem = ctx.scope.lastEntry.nn
3636
if (elem.name == name) return elem.sym.denot // return self
3737
}
3838
val pre = ctx.owner.thisType

compiler/src/dotty/tools/dotc/core/Scopes.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ object Scopes {
6868
abstract class Scope extends printing.Showable {
6969

7070
/** The last scope-entry from which all others are reachable via `prev` */
71-
private[dotc] def lastEntry: ScopeEntry
71+
private[dotc] def lastEntry: ScopeEntry | Null
7272

7373
/** The number of symbols in this scope (including inherited ones
7474
* from outer scopes).
@@ -203,7 +203,7 @@ object Scopes {
203203

204204
def this(nestingLevel: Int) = this(null, 0, nestingLevel)
205205

206-
private[dotc] var lastEntry: ScopeEntry = initElems
206+
private[dotc] var lastEntry: ScopeEntry | Null = initElems
207207

208208
/** The size of the scope */
209209
private var _size = initSize

compiler/src/dotty/tools/dotc/transform/AccessProxies.scala

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ package dotty.tools
22
package dotc
33
package transform
44

5+
import scala.language.{unsafeNulls => _}
6+
57
import core._
68
import Contexts._
79
import Symbols._

compiler/src/dotty/tools/dotc/transform/ArrayApply.scala

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
package dotty.tools.dotc
22
package transform
33

4+
import scala.language.{unsafeNulls => _}
5+
46
import core._
57
import MegaPhase._
68
import Contexts._

compiler/src/dotty/tools/dotc/transform/ArrayConstructors.scala

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
package dotty.tools.dotc
22
package transform
33

4+
import scala.language.{unsafeNulls => _}
5+
46
import core._
57
import MegaPhase._
68
import Contexts._

compiler/src/dotty/tools/dotc/transform/BeanProperties.scala

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
package dotty.tools.dotc
22
package transform
33

4+
import scala.language.{unsafeNulls => _}
5+
46
import core._
57
import ast.tpd._
68
import Annotations._

compiler/src/dotty/tools/dotc/transform/BetaReduce.scala

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ package dotty.tools
22
package dotc
33
package transform
44

5+
import scala.language.{unsafeNulls => _}
6+
57
import core._
68
import Flags._
79
import MegaPhase._

compiler/src/dotty/tools/dotc/transform/Bridges.scala

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ package dotty.tools
22
package dotc
33
package transform
44

5+
import scala.language.{unsafeNulls => _}
6+
57
import core._
68
import Symbols._, Types._, Contexts._, Decorators._, Flags._, Scopes._, Phases._
79
import DenotTransformers._

compiler/src/dotty/tools/dotc/transform/ByNameClosures.scala

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
package dotty.tools.dotc
22
package transform
33

4+
import scala.language.{unsafeNulls => _}
5+
46
import core._
57
import Contexts._
68
import Symbols._

compiler/src/dotty/tools/dotc/transform/CapturedVars.scala

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
package dotty.tools.dotc
22
package transform
33

4+
import scala.language.{unsafeNulls => _}
5+
46
import MegaPhase._
57
import core.DenotTransformers._
68
import core.Symbols._
@@ -52,10 +54,10 @@ class CapturedVars extends MiniPhase with IdentityDenotTransformer:
5254
Set(refClass(defn.ObjectClass), volatileRefClass(defn.ObjectClass))
5355
}
5456

55-
private var myRefInfo: RefInfo = null
56-
private def refInfo(using Context) = {
57+
private var myRefInfo: RefInfo | Null = null
58+
private def refInfo(using Context): RefInfo = {
5759
if (myRefInfo == null) myRefInfo = new RefInfo()
58-
myRefInfo
60+
myRefInfo.asInstanceOf[RefInfo]
5961
}
6062

6163
private class CollectCaptured extends TreeTraverser {

0 commit comments

Comments
 (0)