-
Notifications
You must be signed in to change notification settings - Fork 539
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Bug] configured derivation withDefaults fails on class with type parameters and defaults #2093
Comments
I'm looking into a solution, but I'm really not good with macros, if someone with more experience can lend a hand it would be greatly appreciated. Some more context: lampepfl/dotty-feature-requests#162 |
When the class is generic this line: companion.declaredMethod(s"$$lessinit$$greater$$default$$${i + 1}").headOption.map(Select(Ref(companion), _)) should be companion.declaredMethod(s"$$lessinit$$greater$$default$$${i + 1}").headOption.map(s => Ref(companion).select(s).appliedToTypes(TypeRepr.of[T].typeArgs)) I just need to find a way to distinguish between a generic class and a non generic class. |
The following code fails
Error
The code compiles if you remove the default value for the parameter, i.e.
Sorry I am not familiar with scala 3 derivation enough to help debug this error.
cc @Lasering
The text was updated successfully, but these errors were encountered: