Skip to content

Commit 978a714

Browse files
committed
Initial version of RefChecks
This is still disabled, because the prepare machinery in transform does not work yet. Concretely, prepare ops need to return a new TreeTransform but that tree transform has an undefined phaase id. We need some architectural changes to disentangle transforms from phases.
1 parent 9ec3a4f commit 978a714

File tree

4 files changed

+1389
-7
lines changed

4 files changed

+1389
-7
lines changed

src/dotty/tools/dotc/Compiler.scala

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import Contexts._
66
import Periods._
77
import Symbols._
88
import Scopes._
9-
import typer.{FrontEnd, Typer, Mode, ImportInfo}
9+
import typer.{FrontEnd, Typer, Mode, ImportInfo, RefChecks}
1010
import reporting.ConsoleReporter
1111
import dotty.tools.dotc.core.Phases.Phase
1212
import dotty.tools.dotc.transform._
@@ -21,8 +21,8 @@ class Compiler {
2121
List(new FrontEnd),
2222
List(new FirstTransform),
2323
List(new SuperAccessors),
24-
// pickling and refchecks goes here
25-
List(/*new RefChecks,*/ new ElimRepeated, new ElimLocals),
24+
// pickling goes here
25+
List(/*new RefChecks, */new ElimRepeated, new ElimLocals),
2626
List(new ExtensionMethods),
2727
List(new TailRec),
2828
List(new PatternMatcher,

src/dotty/tools/dotc/core/Phases.scala

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ import config.Printers._
1010
import scala.collection.mutable.{ListBuffer, ArrayBuffer}
1111
import dotty.tools.dotc.transform.TreeTransforms.{TreeTransformer, TreeTransform}
1212
import dotty.tools.dotc.transform.TreeTransforms
13-
import TreeTransforms.Separator
1413
import Periods._
1514

1615
trait Phases {

src/dotty/tools/dotc/transform/OverridingPairs.scala

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,15 @@ import collection.mutable.HashMap
88
import collection.immutable.BitSet
99
import scala.annotation.tailrec
1010

11-
/** A class that yields a kind of iterator (`Cursor`),
11+
/** A module that can produce a kind of iterator (`Cursor`),
1212
* which yields all pairs of overriding/overridden symbols
1313
* that are visible in some baseclass, unless there's a parent class
1414
* that already contains the same pairs.
1515
*
1616
* Adapted from the 2.9 version of OverridingPairs. The 2.10 version is IMO
1717
* way too unwieldy to be maintained.
1818
*/
19-
abstract class OverridingPairs {
19+
object OverridingPairs {
2020

2121
/** The cursor class
2222
* @param base the base class that contains the overriding pairs
@@ -102,7 +102,7 @@ abstract class OverridingPairs {
102102
def hasNext: Boolean = curEntry ne null
103103

104104
@tailrec
105-
final def next: Unit = {
105+
final def next(): Unit = {
106106
if (curEntry ne null) {
107107
overriding = curEntry.sym
108108
if (nextEntry ne null) {

0 commit comments

Comments
 (0)