Closed Zhuinden closed 3 years ago
Apparently the tests don't compile at all and you need to type a bunch of <Object>
s in the assertions, because it claims that type inference is ambiguous.
Rather interesting. Either way, thankfully Java 7 is the most reliable thing to use for Android anyways, may as well stick to it while able.
Using the library as a library is not affected, only if the source is directly added to the project.
By reading https://docs.oracle.com/javase/specs/jls/se7/html/jls-8.html#jls-8.4.1, T... is really is T[].
There's a good chance that if this becomes a problem, I'll just convert the whole thing to Kotlin 🤔
So the library is exposed as a Java 1.7 library, and it's a good thing that it is.
That way, the tests compile, and the library works correctly. 👍
However, if the library is compiled with Java 1.8, then you can get stupid things like
History.of(root)
being resolved to be expected to beObject[]
instead ofObject
, which it is not, and an explicit<Object>
would be needed (the problem happened whenjumpToRoot()
was called, copying the project source code into a Java 8 project directly).This might require more investigation, although it does work correctly. Thanks Java 8 for cryptic problems, though - never expected to see that kind of thing around here. 🤔