File tree 3 files changed +16
-5
lines changed
compiler/src/dotty/tools/dotc/transform
3 files changed +16
-5
lines changed Original file line number Diff line number Diff line change @@ -75,6 +75,13 @@ class PostTyper extends MacroTransform with InfoTransformer { thisPhase =>
75
75
76
76
override def changesMembers : Boolean = true // the phase adds super accessors and synthetic members
77
77
78
+ /**
79
+ * Serializable and AbstractFunction are added for scala2-library companion object of case class
80
+ *
81
+ * Ideally `compilingScala2StdLib` should be used, but it is initialized too late to be effective.
82
+ */
83
+ override def changesParents : Boolean = true
84
+
78
85
override def transformPhase (using Context ): Phase = thisPhase.next
79
86
80
87
def newTransformer (using Context ): Transformer =
Original file line number Diff line number Diff line change @@ -36,12 +36,16 @@ class Checker extends Phase:
36
36
traverser.traverse(unit.tpdTree)
37
37
38
38
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 )
40
40
val traverser = new InitTreeTraverser ()
41
- val unitContexts = units.map(unit => checkCtx.fresh.setCompilationUnit(unit))
42
41
43
42
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
45
49
46
50
cancellable {
47
51
val classes = traverser.getClasses()
Original file line number Diff line number Diff line change @@ -11,6 +11,7 @@ import StdNames.*
11
11
import Names .TermName
12
12
import NameKinds .OuterSelectName
13
13
import NameKinds .SuperAccessorName
14
+ import Decorators .*
14
15
15
16
import ast .tpd .*
16
17
import util .{ SourcePosition , NoSourcePosition }
@@ -66,12 +67,11 @@ import dotty.tools.dotc.core.Flags.AbstractOrTrait
66
67
* whole-program analysis. However, the check is not modular in terms of project boundaries.
67
68
*
68
69
*/
69
- import Decorators .*
70
70
class Objects (using Context @ constructorOnly):
71
71
val immutableHashSetBuider : Symbol = requiredClass(" scala.collection.immutable.HashSetBuilder" )
72
72
// TODO: this should really be an annotation on the rhs of the field initializer rather than the field itself.
73
73
val HashSetBuilder_rootNode : Symbol = immutableHashSetBuider.requiredValue(" rootNode" )
74
-
74
+
75
75
val whiteList = Set (HashSetBuilder_rootNode )
76
76
77
77
// ----------------------------- abstract domain -----------------------------
You can’t perform that action at this time.
0 commit comments