Skip to content

Commit

Permalink
support scala 3 type-level wildcards from _ to ?
Browse files Browse the repository at this point in the history
  • Loading branch information
DmytroOrlov committed Oct 18, 2023
1 parent 0851495 commit 00de9d8
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ object ScalaConverter {
case Schema.Type.ARRAY => {
val elementSchema = schema.getElementType
val elementType = typeMatcher.toScalaType(classStore, namespace, elementSchema)
val JavaList = RootClass.newClass("java.util.List[_]")
val JavaList = javaListConvertor(targetScalaPartialVersion)
val applyParam = REF("array") DOT("iterator")
val elementConversion = convertFromJava(
classStore,
Expand Down Expand Up @@ -314,4 +314,9 @@ object ScalaConverter {
}
}

def javaListConvertor(targetScalaPartialVersion: String) =
if (targetScalaPartialVersion.startsWith("3."))
RootClass.newClass("java.util.List[?]")
else
RootClass.newClass("java.util.List[_]")
}

0 comments on commit 00de9d8

Please sign in to comment.