File tree Expand file tree Collapse file tree 3 files changed +19
-0
lines changed
compiler/src/dotty/tools/dotc/transform/init Expand file tree Collapse file tree 3 files changed +19
-0
lines changed Original file line number Diff line number Diff line change @@ -111,6 +111,10 @@ class CheckGlobal {
111111 else {
112112 val cdef = cls.defTree.asInstanceOf [TypeDef ]
113113 val tpl = cdef.rhs.asInstanceOf [Template ]
114+
115+ // ignore separately compiled classes
116+ if ! tpl.unforced.isInstanceOf [List [_]] then return Nil
117+
114118 var dependencies : List [Dependency ] = Nil
115119 val traverser = new TreeTraverser {
116120 override def traverse (tree : Tree )(using Context ): Unit =
Original file line number Diff line number Diff line change 1+ class IdAndMsg (val id : Int , val msg : String = " " )
2+
3+ case object ObjA extends IdAndMsg (1 ) // error
4+ case object ObjB extends IdAndMsg (2 ) // error
5+
6+ object IdAndMsg { // error
7+ val values = List (ObjA , ObjB )
8+ }
9+
10+ object Test {
11+ def main (args : Array [String ]): Unit = {
12+ ObjA
13+ println(IdAndMsg .values)
14+ }
15+ }
File renamed without changes.
You can’t perform that action at this time.
0 commit comments