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
The following class will cause a compile error: "MyList cannot implement reversed()..."
publicclassMyList<E> implementsList<E> {
@linkList<E> l = newArrayList<>();
}
Note, error is nondeterministic. It happens maybe every other build.
After some digging, the error is a result of how delegation classes are generated wrt implementing interfaces. The order of the interfaces that are implemented is nondeterministic from build to build because javac Type classes don't override hashcode, so it's based on default hashcode. But the real problem is that delegation code does not take into account covariant return types in some cases, which can lead to "cannot implement" compile errors.
The text was updated successfully, but these errors were encountered:
The following class will cause a compile error: "MyList cannot implement reversed()..."
Note, error is nondeterministic. It happens maybe every other build.
After some digging, the error is a result of how delegation classes are generated wrt implementing interfaces. The order of the interfaces that are implemented is nondeterministic from build to build because javac Type classes don't override hashcode, so it's based on default hashcode. But the real problem is that delegation code does not take into account covariant return types in some cases, which can lead to "cannot implement" compile errors.
The text was updated successfully, but these errors were encountered: