java.lang.constant.Constable should be treated as a transparent trait to help Scala.js #17853
sjrd
started this conversation in
Feature Requests
Replies: 0 comments 1 reply
-
Note that the problem in shapeless is caused by the compiler generated case class ValueTypeable[T, B](cB: Class[B], describe: String) |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
See the discussion at typelevel/shapeless-3#1 (comment)
On JDK 12+,
java.lang.constant.Constable
can come up as an inferred LUB of primitive classes likeString
andInteger
. This is problematic on Scala.js (and in the future in Scala Native) since the API ofConstable
cannot be implemented, causing linking errors.In Scala 2, there is not much we can do about it except using explicit type ascriptions to avoid it being inferred. In Scala 3 however, this would easily be solved by treating
Constable
as a transparent trait, like is done (IIRC) forjava.lang.Comparable
.Beta Was this translation helpful? Give feedback.
All reactions