You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Despite my best efforts I couldn't find any relation with what Chimney does, and this error. Using flags for debugging the compilation like -Xlog-implicits, -verbose, -Yquasiquote-debug, -Xprint-pos showed nothing, as if error happened before the macro expansion even started. Increasing stack with -Xss64m doesn't change the outcome.
It might be an error in Chimney, or it might be a particular combination of: an implicit provided by a macro, checking for unused definitions and putting macros into checking unused. Stack trace suggest that error happens in the typer while checking for unused private definitions. Removing any the the flags (-Wmacros:both, -Xlint:unused) makes the error disappear. That's why I created this ticket because I think that without a compiler developer's help I will not be able to tell if the bug is in Chimney or on the compiler.
The text was updated successfully, but these errors were encountered:
Thanks for the report and the diagnostic work. -Wmacros:both says also lint the tree produced by the macro; I see from the stack trace that it is sorting the warnings by position; presumably it's not careful enough about unpositioned trees.
The unpositioned symbol is the unused active$macro$1 parameter, and the bug is to try to use its referenced which is NoSymbol and has no position either.
The broader question is whether it's doing too much work just to sort by position; positions should be ordered even if "undefined".
{
final class $anon extends AnyRef with io.scalaland.chimney.Patcher[ChimneyBug.State.Active,ChimneyBug.Event.A] {
def <init>(): <$anon: io.scalaland.chimney.Patcher[ChimneyBug.State.Active,ChimneyBug.Event.A]> = {
$anon.super.<init>();
()
};
def patch(active$macro$1: ChimneyBug.State.Active, a$macro$1: ChimneyBug.Event.A): ChimneyBug.State.Active = new ChimneyBug.State.Active(a$macro$1.a)
};
new $anon()
}
Worth adding that for 2.13.14, -Wmacros:default does not check the synthetic parameter introduced by the expansion, so that would pass even without the fix.
Reproduction steps
Scala version: I reproduced it on were 2.13.3 and 2.13.12.
Problem
User reported that updating Chimney the newest version resulted in compilation errors. After discussion I managed to reproduce the error:
Despite my best efforts I couldn't find any relation with what Chimney does, and this error. Using flags for debugging the compilation like
-Xlog-implicits
,-verbose
,-Yquasiquote-debug
,-Xprint-pos
showed nothing, as if error happened before the macro expansion even started. Increasing stack with-Xss64m
doesn't change the outcome.It might be an error in Chimney, or it might be a particular combination of: an implicit provided by a macro, checking for unused definitions and putting macros into checking unused. Stack trace suggest that error happens in the typer while checking for unused private definitions. Removing any the the flags (
-Wmacros:both
,-Xlint:unused
) makes the error disappear. That's why I created this ticket because I think that without a compiler developer's help I will not be able to tell if the bug is in Chimney or on the compiler.The text was updated successfully, but these errors were encountered: