public TypeVariableJavaSymbol(String name, JavaSymbol owner) { super(0, name, owner); this.type = new TypeVariableJavaType(this); this.members = new Scope(this); }
public TypeVariableJavaSymbol(String name, JavaSymbol owner) { super(0, name, owner); this.type = new TypeVariableJavaType(this); this.members = new Scope(this); }
private JavaType substituteInTypeVar(TypeVariableJavaType typevar, TypeSubstitution substitution) { // completing owner of type var to ensure type var's bounds have been computed typevar.symbol.owner().complete(); if(typevarExplored.contains(typevar.symbol) || typevar.bounds == null) { return typevar; } typevarExplored.push((JavaSymbol.TypeVariableJavaSymbol) typevar.symbol); List<JavaType> substitutedBounds = typevar.bounds.stream().map(t -> applySubstitution(t, substitution)).collect(Collectors.toList()); typevarExplored.pop(); if(substitutedBounds.equals(typevar.bounds)) { return typevar; } TypeVariableJavaType typeVariableJavaType = new TypeVariableJavaType((JavaSymbol.TypeVariableJavaSymbol) typevar.symbol); typeVariableJavaType.bounds = substitutedBounds; return typeVariableJavaType; }
private JavaType substituteInTypeVar(TypeVariableJavaType typevar, TypeSubstitution substitution) { // completing owner of type var to ensure type var's bounds have been computed typevar.symbol.owner().complete(); if(typevarExplored.contains(typevar.symbol) || typevar.bounds == null) { return typevar; } typevarExplored.push((JavaSymbol.TypeVariableJavaSymbol) typevar.symbol); List<JavaType> substitutedBounds = typevar.bounds.stream().map(t -> applySubstitution(t, substitution)).collect(Collectors.toList()); typevarExplored.pop(); if(substitutedBounds.equals(typevar.bounds)) { return typevar; } TypeVariableJavaType typeVariableJavaType = new TypeVariableJavaType((JavaSymbol.TypeVariableJavaSymbol) typevar.symbol); typeVariableJavaType.bounds = substitutedBounds; return typeVariableJavaType; }