Skip to content

Handling Java enums defined with some utility methods #720

@kamilkloch

Description

@kamilkloch

It does work for Scala 2.
EDIT: It does work for Scala 3, when all the files are located in a single module.

Repo with the issue: https://github.com/kamilkloch/chimney_issues

For Scala 3 compilation fails with an error:

Chimney can't derive transformation from p1.Side to p2.Side

  macro expansion thrown exception!: java.lang.AssertionError: assertion failed: expected a term symbol, but received class Side:
  	scala.runtime.Scala3RunTime$.assertFailed(Scala3RunTime.scala:8)
  	scala.quoted.runtime.impl.QuotesImpl$reflect$Ref$.apply(QuotesImpl.scala:475)
  	scala.quoted.runtime.impl.QuotesImpl$reflect$Ref$.apply(QuotesImpl.scala:474)
  	io.scalaland.chimney.internal.compiletime.datatypes.ProductTypesPlatform$ProductType$.parseConstructor$$anonfun$1$$anonfun$1(ProductTypesPlatform.scala:149)
  	io.scalaland.chimney.internal.compiletime.datatypes.SingletonTypes$SingletonType$.parse(SingletonTypes.scala:39)
  	io.scalaland.chimney.internal.compiletime.datatypes.SingletonTypes$SingletonType$.unapply(SingletonTypes.scala:50)
  	io.scalaland.chimney.internal.compiletime.datatypes.SingletonTypes$Singleton$.unapply(SingletonTypes.scala:15)
  	io.scalaland.chimney.internal.compiletime.derivation.transformer.rules.TransformToSingletonRuleModule$TransformToSingletonRule$.expand(TransformToSingletonRuleModule.scala:18)
  	io.scalaland.chimney.internal.compiletime.derivation.transformer.rules.TransformationRules.io$scalaland$chimney$internal$compiletime$derivation$transformer$rules$TransformationRules$Rule$$$_$expandRules$$anonfun$2(TransformationRules.scala:43)
  	io.scalaland.chimney.internal.compiletime.DerivationResult$.namedScope$$anonfun$2(DerivationResult.scala:218)

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugErroneous behavior in existing featureshelp wanted

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions