Example #1
0
  private Set<InterfaceType> getAllInterfaces(ClassElement classElement) {
    // TODO(johnlenz): All interfaces here should not include the super class implemented interfaces
    // those are handled by the super-class definition.
    Set<InterfaceType> interfaces = Sets.newLinkedHashSet();
    if (classElement.getType() == null) {
      throw new InternalCompilerException("type is null on ClassElement " + classElement);
    }
    // A class needs to implement its own implied interface so the "is"
    // implementation works properly.
    interfaces.add(classElement.getType());

    for (InterfaceType current = classElement.getType();
        current != null;
        current = current.getElement().getSupertype()) {
      // TODO(johnlenz): Maybe use "getAllSupertypes" on the interface element instead
      addAllInterfaces(interfaces, current);
    }
    return interfaces;
  }
 private void process(DartIdentifier node, ClassElement binding) {
   InterfaceType element = binding.getType();
   if (element != null) {
     processType(node, element);
   }
 }