Search in sources :

Example 1 with IntrinsicData

use of dyvilx.tools.compiler.ast.method.intrinsic.IntrinsicData in project Dyvil by Dyvil.

the class AbstractCall method checkArguments.

// every resolveCall implementation calls this
protected final IValue checkArguments(MarkerList markers, IContext context, IMethod method) {
    this.method = method;
    final IntrinsicData intrinsicData = method.getIntrinsicData();
    final int code;
    final IValue intrinsic;
    if (// Intrinsic annotation
    intrinsicData != null && // compilerCode argument
    (code = intrinsicData.getCompilerCode()) != 0 && // valid intrinsic
    (intrinsic = Intrinsics.getOperator(code, this.receiver, this.arguments)) != null) {
        Deprecation.checkAnnotations(method, this.position, markers);
        intrinsic.setPosition(this.position);
        return intrinsic;
    }
    final GenericData genericData;
    if (this.genericData != null) {
        genericData = this.genericData = method.getGenericData(this.genericData, this.receiver, this.arguments);
    } else {
        genericData = this.getGenericData();
    }
    this.receiver = method.checkArguments(markers, this.position, context, this.receiver, this.arguments, genericData);
    this.type = null;
    this.type = this.getType();
    return OptionalChainAware.transform(this);
}
Also used : IValue(dyvilx.tools.compiler.ast.expression.IValue) IntrinsicData(dyvilx.tools.compiler.ast.method.intrinsic.IntrinsicData) GenericData(dyvilx.tools.compiler.ast.generic.GenericData)

Aggregations

IValue (dyvilx.tools.compiler.ast.expression.IValue)1 GenericData (dyvilx.tools.compiler.ast.generic.GenericData)1 IntrinsicData (dyvilx.tools.compiler.ast.method.intrinsic.IntrinsicData)1