mirror of
https://github.com/enso-org/enso.git
synced 2024-11-23 08:08:34 +03:00
Turn null into UnexpectedExpression when Union type is incomplete (#6415)
Test and fix for #6401.
This commit is contained in:
parent
b8f075a178
commit
63de18e367
@ -1084,6 +1084,9 @@ final class TreeToIr {
|
||||
}
|
||||
case Tree.OprApp app -> {
|
||||
var op = app.getOpr().getRight();
|
||||
if (op == null) {
|
||||
yield translateSyntaxError(app, IR$Error$Syntax$UnexpectedExpression$.MODULE$);
|
||||
}
|
||||
yield switch (op.codeRepr()) {
|
||||
case "." -> {
|
||||
final Option<IdentifiedLocation> loc = getIdentifiedLocation(tree);
|
||||
|
@ -192,6 +192,14 @@ public class ErrorCompilerTest extends CompilerTest {
|
||||
assertSingleSyntaxError(ir, IR$Error$Syntax$UnexpectedExpression$.MODULE$, "Unexpected expression", 0, 20);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void malformedTypeException() throws Exception {
|
||||
var ir = parse("""
|
||||
fan_out_to_columns : Table -> Text | Integer -> (Any -> Vector Any) -> | Nothing -> Problem_Behavior -> Table | Nothing
|
||||
""");
|
||||
assertSingleSyntaxError(ir, IR$Error$Syntax$UnexpectedExpression$.MODULE$, "Unexpected expression", 48, 119);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void malformedImport11() throws Exception {
|
||||
var ir = parse("from import all");
|
||||
|
Loading…
Reference in New Issue
Block a user