use of dyvilx.tools.compiler.ast.type.typevar.TypeVarType in project Dyvil by Dyvil.
the class ArrayType method getConcreteType.
@Override
public IType getConcreteType(ITypeContext context) {
IType concrete = this.type.getConcreteType(context);
final TypeVarType typeVar = this.type.extract(TypeVarType.class);
if (typeVar != null && concrete.isPrimitive() && !typeVar.getTypeVariable().isAny()) {
concrete = concrete.getObjectType();
}
if (concrete != null && concrete != this.type) {
return new ArrayType(concrete, this.mutability);
}
return this;
}
use of dyvilx.tools.compiler.ast.type.typevar.TypeVarType in project Dyvil by Dyvil.
the class CodeMethod method writeReifyArgument.
private void writeReifyArgument(MethodWriter writer, ITypeParameter thisParameter, Reified.Type reifiedType, ITypeParameter overrideParameter) {
overrideParameter.writeParameter(writer);
if (overrideParameter.getReifiedKind() == null) {
this.writeDefaultReifyArgument(writer, thisParameter, reifiedType);
return;
}
// Delegate to the TypeVarType implementation
final TypeVarType typeVarType = new TypeVarType(overrideParameter);
typeVarType.checkType(MarkerList.BLACKHOLE, this, TypePosition.REIFY_FLAG);
if (reifiedType == Reified.Type.TYPE) {
typeVarType.writeTypeExpression(writer);
return;
}
typeVarType.writeClassExpression(writer, reifiedType == Reified.Type.OBJECT_CLASS);
}
use of dyvilx.tools.compiler.ast.type.typevar.TypeVarType in project Dyvil by Dyvil.
the class AbstractClass method getThisType.
@Override
public IType getThisType() {
if (this.thisType != null) {
return this.thisType;
}
if (this.typeParameters == null) {
return this.thisType = this.classType;
}
final ClassGenericType type = new ClassGenericType(this);
final TypeList arguments = type.getArguments();
for (int i = 0; i < this.typeParameters.size(); i++) {
arguments.add(new TypeVarType(this.typeParameters.get(i)));
}
return this.thisType = type;
}
Aggregations