Interaction with Java's raw generic types is not possible
See original GitHub issueSee for instance Javafx’s method https://docs.oracle.com/javase/8/javafx/api/javafx/scene/control/TreeTableView.html#setColumnResizePolicy-javafx.util.Callback- it takes a Callback<TreeTableView.ResizeFeatures,Boolean>
but do notice that ResizeFeatures
defines one generic parameter, the method defines a callback that takes it raw though. In scalac, you would pass a javafx.util.Callback[javafx.scene.control.TreeTableView.ResizeFeatures[_], Boolean]
and it would typecheck, but with dottyc it doesn’t work
Issue Analytics
- State:
- Created 6 years ago
- Comments:6 (4 by maintainers)
Top Results From Across the Web
Java Raw Type and generics interaction - Stack Overflow
All of them are unsafe because Java generics, by virtue of type erasure, are just syntactic sugar. For example, this is entirely valid...
Read more >Effective Java Generics | Item 26: Don't use raw types - InformIT
Item 26: Don't use raw types ... First, a few terms. A class or interface whose declaration has one or more type parameters...
Read more >Raw Types - Learning the Java Language
However, a non-generic class or interface type is not a raw type. Raw types show up in legacy code because lots of API...
Read more >4.1. Generic Types - Java in a Nutshell, 5th Edition [Book]
A generic type used without type parameters is known as a raw type . Existing pre-5.0 code continues to work: you simply write...
Read more >Convert Raw Types to Generics refactoring - IntelliJ IDEA
IntelliJ IDEA tries to generate code, which is as correct as possible from the Java point of view. In other words, each context...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Yes, for now we’ve decided to not try to make the dotty Java source parser work with raw types since it’s usually pretty easy to fix Java code in your own project to not require raw types. We may change this in the future but it’s low priority.
Also worth noting, that if you happen to try and compile the java source in mixed mode with dotty (by placing the file under src/main/java), then when dotty parses the java file for the signatures you get this