class types are not provably distinct when they belong to one hierarchy

This commit is contained in:
anna
2011-07-12 19:12:51 +04:00
parent aca6431325
commit 2e7f8bf8bb
2 changed files with 30 additions and 3 deletions
@@ -509,3 +509,24 @@ class Refx<T> {
return (Class<Enum>)get() == Enum.class;
}
}
//hierarchy of type param bound
abstract class DomInvocationHandler<T extends AbstractDomChildDescriptionImpl> {
void f() {
if (this instanceof IndexedElementInvocationHandler) {
}
}
}
interface AbstractDomChildrenDescription {
}
class AbstractDomChildDescriptionImpl implements AbstractDomChildrenDescription {
}
class IndexedElementInvocationHandler extends DomInvocationHandler<FixedChildDescriptionImpl> {
}
class FixedChildDescriptionImpl extends AbstractDomChildDescriptionImpl {
}