|
|
@ -206,7 +206,7 @@ public final class Checker implements ActualParameterVisitor<FormalParameter, Vo |
|
|
|
|
|
|
|
|
|
|
|
if (binding instanceof BinaryOperatorDeclaration) { |
|
|
|
if (binding instanceof BinaryOperatorDeclaration) { |
|
|
|
BinaryOperatorDeclaration bbinding = (BinaryOperatorDeclaration)binding; |
|
|
|
BinaryOperatorDeclaration bbinding = (BinaryOperatorDeclaration)binding; |
|
|
|
if (bbinding.ARG1.equals(StdEnvironment.anyType)) { |
|
|
|
if (bbinding.ARG1 == StdEnvironment.anyType) { |
|
|
|
// this operator must be "=" or "\="
|
|
|
|
// this operator must be "=" or "\="
|
|
|
|
checkAndReportError(e1Type.equals(e2Type), "incompatible argument types for \"%\"", ast.O, ast); |
|
|
|
checkAndReportError(e1Type.equals(e2Type), "incompatible argument types for \"%\"", ast.O, ast); |
|
|
|
} else { |
|
|
|
} else { |
|
|
@ -691,10 +691,11 @@ public final class Checker implements ActualParameterVisitor<FormalParameter, Vo |
|
|
|
public TypeDenoter visitDotVname(DotVname ast, Void arg) { |
|
|
|
public TypeDenoter visitDotVname(DotVname ast, Void arg) { |
|
|
|
ast.type = null; |
|
|
|
ast.type = null; |
|
|
|
var vType = ast.V.visit(this); |
|
|
|
var vType = ast.V.visit(this); |
|
|
|
|
|
|
|
ast.variable = ast.V.variable; |
|
|
|
if (vType instanceof RecordTypeDenoter) { |
|
|
|
if (vType instanceof RecordTypeDenoter) { |
|
|
|
RecordTypeDenoter record = (RecordTypeDenoter)vType; |
|
|
|
RecordTypeDenoter record = (RecordTypeDenoter)vType; |
|
|
|
ast.type = checkFieldIdentifier(record.FT, ast.I); |
|
|
|
ast.type = checkFieldIdentifier(record.FT, ast.I); |
|
|
|
checkAndReportError(!ast.type.equals(StdEnvironment.errorType), "no field \"%\" in this record type", |
|
|
|
checkAndReportError(ast.type != StdEnvironment.errorType, "no field \"%\" in this record type", |
|
|
|
ast.I); |
|
|
|
ast.I); |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
reportError("record expected here", ast.V); |
|
|
|
reportError("record expected here", ast.V); |
|
|
@ -710,9 +711,11 @@ public final class Checker implements ActualParameterVisitor<FormalParameter, Vo |
|
|
|
var binding = ast.I.visit(this); |
|
|
|
var binding = ast.I.visit(this); |
|
|
|
if (binding instanceof ConstantDeclaration) { |
|
|
|
if (binding instanceof ConstantDeclaration) { |
|
|
|
ConstantDeclaration constant = (ConstantDeclaration)binding; |
|
|
|
ConstantDeclaration constant = (ConstantDeclaration)binding; |
|
|
|
|
|
|
|
ast.variable = false; |
|
|
|
return ast.type = constant.getType(); |
|
|
|
return ast.type = constant.getType(); |
|
|
|
} else if (binding instanceof VariableDeclaration) { |
|
|
|
} else if (binding instanceof VariableDeclaration) { |
|
|
|
VariableDeclaration variable = (VariableDeclaration)binding; |
|
|
|
VariableDeclaration variable = (VariableDeclaration)binding; |
|
|
|
|
|
|
|
ast.variable = true; |
|
|
|
return ast.type = variable.getType(); |
|
|
|
return ast.type = variable.getType(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|