File tree Expand file tree Collapse file tree 3 files changed +16
-5
lines changed
compiler/src/dotty/tools/dotc/transform Expand file tree Collapse file tree 3 files changed +16
-5
lines changed Original file line number Diff line number Diff line change @@ -76,6 +76,13 @@ class PostTyper extends MacroTransform with InfoTransformer { thisPhase =>
7676
7777 override def changesMembers : Boolean = true // the phase adds super accessors and synthetic members
7878
79+ /**
80+ * Serializable and AbstractFunction are added for scala2-library companion object of case class
81+ *
82+ * Ideally `compilingScala2StdLib` should be used, but it is initialized too late to be effective.
83+ */
84+ override def changesParents : Boolean = true
85+
7986 override def transformPhase (using Context ): Phase = thisPhase.next
8087
8188 def newTransformer (using Context ): Transformer =
Original file line number Diff line number Diff line change @@ -36,12 +36,16 @@ class Checker extends Phase:
3636 traverser.traverse(unit.tpdTree)
3737
3838 override def runOn (units : List [CompilationUnit ])(using Context ): List [CompilationUnit ] =
39- val checkCtx = ctx.fresh.setPhase(this .start )
39+ val checkCtx = ctx.fresh.setPhase(this )
4040 val traverser = new InitTreeTraverser ()
41- val unitContexts = units.map(unit => checkCtx.fresh.setCompilationUnit(unit))
4241
4342 val units0 =
44- for unitContext <- unitContexts if traverse(traverser)(using unitContext) yield unitContext.compilationUnit
43+ for
44+ unit <- units
45+ unitContext = checkCtx.fresh.setCompilationUnit(unit)
46+ if traverse(traverser)(using unitContext)
47+ yield
48+ unitContext.compilationUnit
4549
4650 cancellable {
4751 val classes = traverser.getClasses()
Original file line number Diff line number Diff line change @@ -11,6 +11,7 @@ import StdNames.*
1111import Names .TermName
1212import NameKinds .OuterSelectName
1313import NameKinds .SuperAccessorName
14+ import Decorators .*
1415
1516import ast .tpd .*
1617import util .{ SourcePosition , NoSourcePosition }
@@ -66,12 +67,11 @@ import dotty.tools.dotc.core.Flags.AbstractOrTrait
6667 * whole-program analysis. However, the check is not modular in terms of project boundaries.
6768 *
6869 */
69- import Decorators .*
7070class Objects (using Context @ constructorOnly):
7171 val immutableHashSetBuider : Symbol = requiredClass(" scala.collection.immutable.HashSetBuilder" )
7272 // TODO: this should really be an annotation on the rhs of the field initializer rather than the field itself.
7373 val HashSetBuilder_rootNode : Symbol = immutableHashSetBuider.requiredValue(" rootNode" )
74-
74+
7575 val whiteList = Set (HashSetBuilder_rootNode )
7676
7777 // ----------------------------- abstract domain -----------------------------
You can’t perform that action at this time.
0 commit comments