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 program generates a diagnostic: Type String cannot be safely cast to Example<String> that is misleading. This is not a situation that involves unsafe generic cast. This is a patent type incompatibility error. Javac reports: error: incompatible types: String cannot be converted to Example<String>.
class Example<T> {
private void foo(String x) {
if (x instanceof Example<String> es) {
}
}
}
The text was updated successfully, but these errors were encountered:
The following program generates a diagnostic:
Type String cannot be safely cast to Example<String>
that is misleading. This is not a situation that involves unsafe generic cast. This is a patent type incompatibility error. Javac reports:error: incompatible types: String cannot be converted to Example<String>
.The text was updated successfully, but these errors were encountered: