RuntimeType implements InferredType { @Override public Optional<Symbol> resolveMember(String memberName) { return typeClass.resolveMember(memberName); } RuntimeType(ClassSymbol typeClass); @Override boolean isIdentityComparableWith(InferredType other); @Override boolean canHaveMember(String memberName); @Override boolean declaresMember(String memberName); @Override Optional<Symbol> resolveMember(String memberName); @Override Optional<Symbol> resolveDeclaredMember(String memberName); @Override boolean canOnlyBe(String typeName); @Override boolean canBeOrExtend(String typeName); @Override boolean isCompatibleWith(InferredType other); boolean mustBeOrExtend(String fullyQualifiedName); @Override boolean equals(Object o); @Override int hashCode(); @Override String toString(); ClassSymbol getTypeClass();  }
@Test public void overridden_symbol() { ClassSymbolImpl x = new ClassSymbolImpl("x", "x"); SymbolImpl fooX = new SymbolImpl("foo", null); x.addMembers(singletonList(fooX)); assertThat(new RuntimeType(x).resolveMember("foo")).contains(fooX); ClassSymbolImpl x1 = new ClassSymbolImpl("x1", "x1"); SymbolImpl fooX1 = new SymbolImpl("foo", null); x1.addSuperClass(x); x1.addMembers(singletonList(fooX1)); assertThat(new RuntimeType(x1).resolveMember("foo")).contains(fooX1); ClassSymbolImpl y = new ClassSymbolImpl("y", "y"); y.addMembers(singletonList(new SymbolImpl("foo", null))); ClassSymbolImpl z = new ClassSymbolImpl("z", "z"); z.addSuperClass(x); z.addSuperClass(y); assertThat(new RuntimeType(z).resolveMember("foo")).contains(fooX); }