DeclaredType implements InferredType { boolean hasUnresolvedHierarchy() { if (alternativeTypeSymbols.isEmpty()) { return true; } for (Symbol alternativeTypeSymbol : alternativeTypeSymbols) { if (!alternativeTypeSymbol.is(CLASS) || ((ClassSymbol) alternativeTypeSymbol).hasUnresolvedTypeHierarchy()) { return true; } } return false; } DeclaredType(Symbol typeClass, List<DeclaredType> typeArgs);   DeclaredType(Symbol typeClass); @Override boolean canHaveMember(String memberName); @Override boolean declaresMember(String memberName); @Override boolean isIdentityComparableWith(InferredType other); @Override Optional<Symbol> resolveMember(String memberName); @Override Optional<Symbol> resolveDeclaredMember(String memberName); @Override boolean canBeOrExtend(String typeName); @Override boolean canOnlyBe(String typeName); @Override boolean isCompatibleWith(InferredType other); @Override boolean mustBeOrExtend(String typeName); @Override String toString(); String typeName(); Set<Symbol> alternativeTypeSymbols(); @Override boolean equals(Object o); @Override int hashCode(); static InferredType fromInferredType(InferredType inferredType);  }
@Test public void test_hasUnresolvedHierarchy() { ClassSymbolImpl typeClassX = new ClassSymbolImpl("x", "x"); DeclaredType declaredTypeX = new DeclaredType(typeClassX); assertThat(declaredTypeX.hasUnresolvedHierarchy()).isFalse(); DeclaredType union = new DeclaredType(new SymbolImpl("Union", "typing.Union")); assertThat(union.hasUnresolvedHierarchy()).isTrue(); DeclaredType unresolved = new DeclaredType(new SymbolImpl("unresolved", "unresolved")); union = new DeclaredType(new SymbolImpl("Union", "typing.Union"), Arrays.asList(declaredTypeX, unresolved)); assertThat(union.hasUnresolvedHierarchy()).isTrue(); }