softwaremill / magnolia

Easy, fast, transparent generic derivation of typeclass instances
https://softwaremill.com/open-source/
Apache License 2.0
754 stars 116 forks source link

[bugfix] Suppress unsafe type check warning #473

Closed kciesielski closed 1 year ago

kciesielski commented 1 year ago

This fix removes a warning, which happens for Magnolia usages on generic types in case class params. The casting is generally safe except when there are default values overridden with different type, which is probably a very rare situation. A proper fix would require a broader change, touching the way default values are resolved, which doesn't seem worth pursuing at the moment. For the record, I added a commented test to reflect this case.