Skip to content

java higher-kind interop fails with dotty #16797

Discussion options

You must be logged in to vote

Java doesn't have higher-kinded types: while you can write java.util.List without passing type arguments to it, it is equivalent to java.util.List<?> (it's a raw type). When compiling a mixed java/scala project, the Scala compiler also typechecks Java sources, so it will error out on HigkerKind<java.util.List> which it will interpret as the Scala type HigherKind[java.util.List[?]].

I'm not sure why it doesn't happen in Scala 2 though. What's your usecase? If the Scala code doesn't depend on the Java code, you could set up your build tool so the Scala compiler doesn't see the Java code at all (in sbt: compileOrder := CompileOrder.ScalaThenJava)

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@RustedBones
Comment options

Answer selected by RustedBones
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants