Heisenbug corruption/loss of surrounding tree with -Yretain-trees
when a transparent macro with an implicit parameter is executed in the same file
#21622
Labels
area:implicits
related to implicits
area:private options
Issues tied to -Y private/internal compiler settings.
itype:bug
stat:needs minimization
Needs a self contained minimization
Compiler version
Tested on 3.5.1, 3.3.4-RC1, 3.3.4-RC2, 3.3.4-RC4
Minimized code
Best reproduction is on izumi library branch, to reproduce execute:
The failure is also reproducible in the following scastie: https://scastie.scala-lang.org/ABzjHtjsTkW1BQlngBqLsw , but the scastie lacks the context of the surrounding library
Output
Expectation
The error is an internal library error that happens because the
make
macro call somehow receives a corrupt/empty surrounding tree that lacks the subsequent.from
call that themake
macro expects to find.I call this a Heisenbug because it appears rarely and it will disappear if you make any minor modification to the affected file, such as add a newline or a comment [1].
The way this bug may be "fixed" is also extremely weird, replacing
implicit m: Mirror.Of[A]
withusing m: Mirror.Of[A]
in another (transparent) macro (makeConfig
) that's executed in the same file "fixes" the issue 7mind/izumi@e7de8b1 (git checkout bug/heisenbug-reproducer-fixer
in the above repo)The text was updated successfully, but these errors were encountered: