Search in sources :

Example 1 with NamedGenericType

use of dyvilx.tools.compiler.ast.type.generic.NamedGenericType in project Dyvil by Dyvil.

the class MethodCall method resolveAlternative.

protected IValue resolveAlternative(MarkerList markers, IContext context, boolean report) {
    if (this.genericData != null && this.arguments == ArgumentList.EMPTY) {
        final IType parentType;
        if (this.receiver == null) {
            parentType = null;
        } else if (this.receiver.isClassAccess()) {
            parentType = this.receiver.getType();
        } else {
            return null;
        }
        final IType type = new NamedGenericType(this.position, parentType, this.name, this.genericData.getTypes()).resolveType(report ? markers : null, context);
        if (type == null) {
            return null;
        }
        return new ClassAccess(this.position, type);
    }
    final IValue access = new FieldAccess(this.position, this.receiver, this.name).resolveAccess(markers, context);
    if (access == null) {
        return null;
    }
    // Field or Class Access available, try to resolve an apply method
    final ApplyAccess call = new ApplyAccess(this.position, access, this.arguments);
    call.genericData = this.genericData;
    return call.resolveCall(markers, context, report);
}
Also used : IValue(dyvilx.tools.compiler.ast.expression.IValue) NamedGenericType(dyvilx.tools.compiler.ast.type.generic.NamedGenericType) IType(dyvilx.tools.compiler.ast.type.IType)

Aggregations

IValue (dyvilx.tools.compiler.ast.expression.IValue)1 IType (dyvilx.tools.compiler.ast.type.IType)1 NamedGenericType (dyvilx.tools.compiler.ast.type.generic.NamedGenericType)1