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
[info] - should support TypeReference***FAILED***
[info] java.lang.IllegalArgumentException:Internalerror: TypeReference constructed without actual typeinformation
[info] at com.fasterxml.jackson.core.type.TypeReference.<init>(TypeReference.java:35)
[info] at com.github.pjfanning.scala3.ClassWithMapsSpec$$anon$1.<init>(ClassWithMapsSpec.scala:12)
This class tries to get the generic super class and this is the parameterized type in Scala 2.13 - eg new TypeReference[ClassWithMaps[String]]{} yields ClassWithMaps[String] but this does not work in Scala 3.0.0-M3.
The text was updated successfully, but these errors were encountered:
smarter
changed the title
Generics use case that works in Scala 2 but not in Scala 3.0.0-M3
Retrieving type arguments through Java reflection does not work
Dec 20, 2020
Minimized code
https://github.com/pjfanning/scala3-sample-classes/blob/annotation-issue/src/test/scala/com/github/pjfanning/scala3/ClassWithMapsSpec.scala
https://github.com/pjfanning/scala3-sample-classes/blob/annotation-issue/src/main/scala/com/github/pjfanning/scala3/ClassWithMaps.scala
Output
Expectation
This test case passes in Scala 2.13.
https://github.com/FasterXML/jackson-core/blob/2.12/src/main/java/com/fasterxml/jackson/core/type/TypeReference.java
This class tries to get the generic super class and this is the parameterized type in Scala 2.13 - eg
new TypeReference[ClassWithMaps[String]]{}
yieldsClassWithMaps[String]
but this does not work in Scala 3.0.0-M3.The text was updated successfully, but these errors were encountered: