use of dyvilx.tools.parsing.marker.Marker in project Dyvil by Dyvil.
the class TypeChecker method typeError.
public static Marker typeError(SourcePosition position, IType expectedType, IType actualType, String error, String expectedError, String actualError) {
final Marker marker = Markers.semanticError(position, error);
marker.addInfo(Markers.getSemantic(expectedError, expectedType));
marker.addInfo(Markers.getSemantic(actualError, actualType));
return marker;
}
use of dyvilx.tools.parsing.marker.Marker in project Dyvil by Dyvil.
the class TypeChecker method typeError.
public static Marker typeError(SourcePosition position, IType expected, IType actual, String key, String expectedError, String actualError, Object... args) {
final Marker marker = Markers.semanticError(position, key, args);
marker.addInfo(Markers.getSemantic(expectedError, expected));
marker.addInfo(Markers.getSemantic(actualError, actual));
return marker;
}
use of dyvilx.tools.parsing.marker.Marker in project Dyvil by Dyvil.
the class ConstructorCall method reportResolve.
protected static void reportResolve(MarkerList markers, MatchList<IConstructor> list, SourcePosition position, IType type, ArgumentList arguments) {
final Marker marker;
if (list == null || !list.isAmbigous()) {
marker = Markers.semanticError(position, "constructor.access.resolve", type.toString());
addArgumentInfo(marker, arguments);
} else {
marker = Markers.semanticError(position, "constructor.access.ambiguous", type.toString());
addArgumentInfo(marker, arguments);
addCandidates(list, marker);
}
markers.add(marker);
}
use of dyvilx.tools.parsing.marker.Marker in project Dyvil by Dyvil.
the class FieldAccess method reportResolve.
@Override
protected void reportResolve(MarkerList markers) {
final Marker marker = Markers.semanticError(this.position, "method.access.resolve.field", this.name);
if (this.receiver != null) {
marker.addInfo(Markers.getSemantic("receiver.type", this.receiver.getType()));
}
markers.add(marker);
}
use of dyvilx.tools.parsing.marker.Marker in project Dyvil by Dyvil.
the class FieldAccess method toReferenceValue.
@Override
public IValue toReferenceValue(MarkerList markers, IContext context) {
if (this.field == null) {
// avoid extra error
return this;
}
final IReference ref;
if (this.field.isLocal()) {
if (!((IVariable) this.field).setReferenceType()) {
final Marker marker = Markers.semanticError(this.position, "reference.variable.invalid", Util.memberNamed(this.field));
markers.add(marker);
return this;
}
ref = new VariableReference(this.field.capture(context));
} else if (this.field.isStatic()) {
ref = new StaticFieldReference((IField) this.field);
} else {
ref = new InstanceFieldReference(this.receiver, (IField) this.field);
}
return new ReferenceOperator(this, ref);
}
Aggregations