Skip to content

filtering SCALAC.MIXIN

Evgeny Mandrikov edited this page Feb 20, 2019 · 5 revisions

This page discusses a not yet available feature!

Description

Scala allows so called mixin-class composition. For technical reasons the methods from the mixin-class are copied into the target class.

Filtering

Methods from mixin-classes are completely removed.

Source Example

class A extends B with C

Bytecode Pattern

The methods of mixin-classes do have the same line number as a constructor.

@dragos: Each mixin forwarder method always forwards to a synthetic static method in a class ending with $class. See this class in the Scala IDE debugger code for how to classify different Scala synthetic methods. The interesting method is isForwarderBytecode.

⚠️ @Godin: line numbers are not totally reliable, because their generation can be disabled, which will lead to inconsistency between reports created with and without debug information.