Search in sources :

Example 1 with WildcardValue

use of dyvilx.tools.compiler.ast.expression.constant.WildcardValue in project Dyvil by Dyvil.

the class LambdaExpr method resolveTypes.

@Override
public void resolveTypes(MarkerList markers, IContext context) {
    this.parameters.resolveTypes(markers, context);
    if (!this.hasImplicitReturnType()) {
        this.returnType = this.returnType.resolveType(markers, context);
    }
    if (this.value != null) {
        context = context.push(this);
        this.value.resolveTypes(markers, context);
        context.pop();
    } else {
        markers.add(Markers.semanticError(this.position, "lambda.value.invalid"));
        this.value = new WildcardValue(this.position);
    }
}
Also used : WildcardValue(dyvilx.tools.compiler.ast.expression.constant.WildcardValue)

Example 2 with WildcardValue

use of dyvilx.tools.compiler.ast.expression.constant.WildcardValue in project Dyvil by Dyvil.

the class ColonOperator method resolve.

@Override
public IValue resolve(MarkerList markers, IContext context) {
    if (this.left != null) {
        this.left = this.left.resolve(markers, context);
    } else {
        markers.add(Markers.semanticError(this.position, "colon_operator.left.invalid"));
        this.left = new WildcardValue(this.position);
    }
    if (this.right != null) {
        this.right = this.right.resolve(markers, context);
    } else {
        markers.add(Markers.semanticError(this.position, "colon_operator.right.invalid"));
        this.right = new WildcardValue(this.position);
    }
    return this;
}
Also used : WildcardValue(dyvilx.tools.compiler.ast.expression.constant.WildcardValue)

Example 3 with WildcardValue

use of dyvilx.tools.compiler.ast.expression.constant.WildcardValue in project Dyvil by Dyvil.

the class PropertyReference method checkTypes.

@Override
public void checkTypes(SourcePosition position, MarkerList markers, IContext context) {
    final Name getterName = this.getterMethod.getName();
    final Name setterName = Util.addEq(getterName);
    this.setterMethod = ICall.resolveMethod(context, this.receiver, setterName, new ArgumentList(new WildcardValue(null)));
    if (this.setterMethod == null || this.setterMethod.getParameters().size() != 1) {
        markers.add(Markers.semanticError(position, "reference.property.no_setter", getterName));
    }
}
Also used : WildcardValue(dyvilx.tools.compiler.ast.expression.constant.WildcardValue) ArgumentList(dyvilx.tools.compiler.ast.parameter.ArgumentList) Name(dyvil.lang.Name)

Aggregations

WildcardValue (dyvilx.tools.compiler.ast.expression.constant.WildcardValue)3 Name (dyvil.lang.Name)1 ArgumentList (dyvilx.tools.compiler.ast.parameter.ArgumentList)1