mirror of
https://github.com/enso-org/enso.git
synced 2024-09-11 13:15:52 +03:00
Syntax error on unexpected unary minus (#8333)
This commit is contained in:
parent
375e610660
commit
705d6f192c
@ -961,6 +961,7 @@ final class TreeToIr {
|
||||
var arg = new CallArgument.Specified(Option.empty(), expr, expr.location(), meta(), diag());
|
||||
yield new Application.Prefix(negate, join(arg, nil()), false, expr.location(), meta(), diag());
|
||||
}
|
||||
case null -> translateSyntaxError(tree, new Syntax.UnsupportedSyntax("Strange unary -"));
|
||||
};
|
||||
case Tree.TypeSignature sig -> {
|
||||
var methodName = buildName(sig.getVariable());
|
||||
|
@ -30,6 +30,17 @@ public class ErrorCompilerTest extends CompilerTest {
|
||||
assertSingleSyntaxError(ir, Syntax.InvalidUnderscore$.MODULE$, "Invalid use of _", 14, 15);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void unaryMinus() throws Exception {
|
||||
var ir = parse("""
|
||||
from Standard.Base import all
|
||||
|
||||
main = Date.new day=-
|
||||
""");
|
||||
|
||||
assertSingleSyntaxError(ir, new Syntax.UnsupportedSyntax("Strange unary -"), "Syntax is not supported yet: Strange unary -", 51, 52);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void dotUnderscore2() throws Exception {
|
||||
var ir = parse("""
|
||||
|
Loading…
Reference in New Issue
Block a user