aboutsummaryrefslogtreecommitdiff
path: root/src/dotty/tools/dotc/transform/MoveStatics.scala
Commit message (Collapse)AuthorAgeFilesLines
* Make class initialisers private. Otherwise they break GenBCode.Dmitry Petrashko2016-06-071-1/+1
| | | | | GenBCode checks if class already has static initialiser, the check is fooled if class inherited a static initialisers.
* MoveStatics: Fix classes without companion not getting static <clinit>Dmitry Petrashko2016-06-071-19/+20
| | | | This broke lazy vals, as unsafe offsets were not initialised.
* MoveStatics: fix a bug.Dmitry Petrashko2016-06-071-1/+2
| | | | Nicely spotted by Ycheck.
* MoveStatics: survive absence of companions.Dmitry Petrashko2016-06-071-14/+24
| | | | | | | Now moveStatics can correctly create static constructors for objects. Those static constructors would later be merged with synthetic module initialisers by GenBCode. This is a bit of magic, it would be good to move all this into this phase.
* MoveStatics: fix two bugs.Dmitry Petrashko2016-06-071-1/+2
| | | | | Unlink the static from the old scope, and don't drop top-level trees that are not TypeDefs.
* MoveStatic: Move static methods & fields into companion classDmitry Petrashko2016-06-071-0/+64
As a funny side-effect this allows to execute arbitrary code in static initialisers: @static val a: Unit = {println("loaded")}