Skip to content

GenBCode uses withCurrentUnit many times for a unit #142

Closed
@retronym

Description

@retronym
try   { withCurrentUnit(item.cunit)(visit(item)) }

for each item populated by:

    override def apply(cunit: CompilationUnit): Unit = {

      def gen(tree: Tree) {
        tree match {
          case EmptyTree            => ()
          case PackageDef(_, stats) => stats foreach gen
          case cd: ClassDef         =>
            q1 add Item1(arrivalPos, cd, cunit)
            arrivalPos += 1
        }
      }

      gen(cunit.body)
    }

This leads to noisy repeated log messages under -Ydebug -verbose (as noticed by @som-snytt.

Not sure whether there are other, less benign problems. But I would recommend reducing the granularity of items to the compilation unit level.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions