public Type asType(boolean nullable, com.google.dart.compiler.type.Type type) { switch (type.getKind()) { case VOID: return CoreTypeRepository.VOID_TYPE; case DYNAMIC: return nullable ? CoreTypeRepository.DYNAMIC_TYPE : CoreTypeRepository.DYNAMIC_NON_NULL_TYPE; case VARIABLE: // return typeRepository.findType(nullable, (ClassElement) // type.getElement()); if (!(type.getElement() instanceof ClassElement)) { return DYNAMIC_NON_NULL_TYPE; } case INTERFACE: return typeRepository.findType(nullable, (ClassElement) type.getElement()); case FUNCTION: return asFunctionType(nullable, (com.google.dart.compiler.type.FunctionType) type); case FUNCTION_ALIAS: return asFunctionType(nullable, ((FunctionAliasType) type).getElement().getFunctionType()); case NONE: default: throw new AssertionError("asType: " + type.getKind() + " must be implemented"); } }
public FunctionType asConstantFunctionType(MethodElement element) { com.google.dart.compiler.type.FunctionType functionType = element.getFunctionType(); return typeRepository.findFunction( false, asType(true, functionType.getReturnType()), asTypeList(functionType.getParameterTypes()), asTypeMap(functionType.getNamedParameterTypes()), element); }
private FunctionType asFunctionType( boolean nullable, com.google.dart.compiler.type.FunctionType functionType) { return typeRepository.findFunction( nullable, asType(true, functionType.getReturnType()), asTypeList(functionType.getParameterTypes()), asTypeMap(functionType.getNamedParameterTypes()), null); }
public Type findType(boolean nullable, ClassElement classElement) { return typeRepository.findType(nullable, classElement); }