More error cleanup

This commit is contained in:
Pranav Gaddamadugu 2022-07-14 13:05:14 -07:00
parent 3e867010b4
commit 906df51241
11 changed files with 11 additions and 11 deletions

View File

@ -40,7 +40,7 @@ create_messages!(
@formatted
unary_overflow {
args: (left: impl Display, op: impl Display),
msg: format!("The const operation `({op} {left}{}` causes an overflow.", type_name(&left)),
msg: format!("The const operation `({op} {left}{})` causes an overflow.", type_name(&left)),
help: None,
}

View File

@ -2,4 +2,4 @@
namespace: Compile
expectation: Fail
outputs:
- "Error [EFLA0373001]: The const operation `(neg -128i8` causes an overflow.\n --> compiler-test:1:1\n |\n 1 | \n | \n"
- "Error [EFLA0373001]: The const operation `(neg -128i8)` causes an overflow.\n --> compiler-test:1:1\n |\n 1 | \n | \n"

View File

@ -2,4 +2,4 @@
namespace: Compile
expectation: Fail
outputs:
- "Error [EFLA0373001]: The const operation `(neg -170141183460469231731687303715884105728i128` causes an overflow.\n --> compiler-test:1:1\n |\n 1 | \n | \nError [ETYC0372002]: Cannot assign a non-const or invalid expression `(neg a)` to const variable `b`\n --> compiler-test:5:5\n |\n 5 | const b: i128 = -a;\n | ^^^^^^^^^^^^^^^^^^\nError [EFLA0373001]: The const operation `(neg -170141183460469231731687303715884105728i128` causes an overflow.\n --> compiler-test:1:1\n |\n 1 | \n | \n"
- "Error [EFLA0373001]: The const operation `(neg -170141183460469231731687303715884105728i128)` causes an overflow.\n --> compiler-test:1:1\n |\n 1 | \n | \nError [ETYC0372002]: Cannot assign a non-const or invalid expression `(neg a)` to const variable `b`\n --> compiler-test:5:5\n |\n 5 | const b: i128 = -a;\n | ^^^^^^^^^^^^^^^^^^\nError [EFLA0373001]: The const operation `(neg -170141183460469231731687303715884105728i128)` causes an overflow.\n --> compiler-test:1:1\n |\n 1 | \n | \n"

View File

@ -2,4 +2,4 @@
namespace: Compile
expectation: Fail
outputs:
- "Error [EFLA0373001]: The const operation `(neg -170141183460469231731687303715884105728i128` causes an overflow.\n --> compiler-test:1:1\n |\n 1 | \n | \nError [ETYC0372002]: Cannot assign a non-const or invalid expression `(neg a)` to const variable `b`\n --> compiler-test:5:5\n |\n 5 | const b: i128 = -a;\n | ^^^^^^^^^^^^^^^^^^\nError [EFLA0373001]: The const operation `(neg -170141183460469231731687303715884105728i128` causes an overflow.\n --> compiler-test:1:1\n |\n 1 | \n | \n"
- "Error [EFLA0373001]: The const operation `(neg -170141183460469231731687303715884105728i128)` causes an overflow.\n --> compiler-test:1:1\n |\n 1 | \n | \nError [ETYC0372002]: Cannot assign a non-const or invalid expression `(neg a)` to const variable `b`\n --> compiler-test:5:5\n |\n 5 | const b: i128 = -a;\n | ^^^^^^^^^^^^^^^^^^\nError [EFLA0373001]: The const operation `(neg -170141183460469231731687303715884105728i128)` causes an overflow.\n --> compiler-test:1:1\n |\n 1 | \n | \n"

View File

@ -2,4 +2,4 @@
namespace: Compile
expectation: Fail
outputs:
- "Error [EFLA0373001]: The const operation `(neg -32768i16` causes an overflow.\n --> compiler-test:1:1\n |\n 1 | \n | \nError [ETYC0372002]: Cannot assign a non-const or invalid expression `(neg a)` to const variable `b`\n --> compiler-test:5:5\n |\n 5 | const b: i16 = -a;\n | ^^^^^^^^^^^^^^^^^\nError [EFLA0373001]: The const operation `(neg -32768i16` causes an overflow.\n --> compiler-test:1:1\n |\n 1 | \n | \n"
- "Error [EFLA0373001]: The const operation `(neg -32768i16)` causes an overflow.\n --> compiler-test:1:1\n |\n 1 | \n | \nError [ETYC0372002]: Cannot assign a non-const or invalid expression `(neg a)` to const variable `b`\n --> compiler-test:5:5\n |\n 5 | const b: i16 = -a;\n | ^^^^^^^^^^^^^^^^^\nError [EFLA0373001]: The const operation `(neg -32768i16)` causes an overflow.\n --> compiler-test:1:1\n |\n 1 | \n | \n"

View File

@ -2,4 +2,4 @@
namespace: Compile
expectation: Fail
outputs:
- "Error [EFLA0373001]: The const operation `(neg -2147483648i32` causes an overflow.\n --> compiler-test:1:1\n |\n 1 | \n | \nError [ETYC0372002]: Cannot assign a non-const or invalid expression `(neg a)` to const variable `b`\n --> compiler-test:5:5\n |\n 5 | const b: i32 = -a;\n | ^^^^^^^^^^^^^^^^^\nError [EFLA0373001]: The const operation `(neg -2147483648i32` causes an overflow.\n --> compiler-test:1:1\n |\n 1 | \n | \n"
- "Error [EFLA0373001]: The const operation `(neg -2147483648i32)` causes an overflow.\n --> compiler-test:1:1\n |\n 1 | \n | \nError [ETYC0372002]: Cannot assign a non-const or invalid expression `(neg a)` to const variable `b`\n --> compiler-test:5:5\n |\n 5 | const b: i32 = -a;\n | ^^^^^^^^^^^^^^^^^\nError [EFLA0373001]: The const operation `(neg -2147483648i32)` causes an overflow.\n --> compiler-test:1:1\n |\n 1 | \n | \n"

View File

@ -2,4 +2,4 @@
namespace: Compile
expectation: Fail
outputs:
- "Error [EFLA0373001]: The const operation `(neg -2147483648i32` causes an overflow.\n --> compiler-test:1:1\n |\n 1 | \n | \nError [ETYC0372002]: Cannot assign a non-const or invalid expression `(neg a)` to const variable `b`\n --> compiler-test:5:5\n |\n 5 | const b: i32 = -a;\n | ^^^^^^^^^^^^^^^^^\nError [EFLA0373001]: The const operation `(neg -2147483648i32` causes an overflow.\n --> compiler-test:1:1\n |\n 1 | \n | \n"
- "Error [EFLA0373001]: The const operation `(neg -2147483648i32)` causes an overflow.\n --> compiler-test:1:1\n |\n 1 | \n | \nError [ETYC0372002]: Cannot assign a non-const or invalid expression `(neg a)` to const variable `b`\n --> compiler-test:5:5\n |\n 5 | const b: i32 = -a;\n | ^^^^^^^^^^^^^^^^^\nError [EFLA0373001]: The const operation `(neg -2147483648i32)` causes an overflow.\n --> compiler-test:1:1\n |\n 1 | \n | \n"

View File

@ -2,4 +2,4 @@
namespace: Compile
expectation: Fail
outputs:
- "Error [EFLA0373001]: The const operation `(neg -9223372036854775808i64` causes an overflow.\n --> compiler-test:1:1\n |\n 1 | \n | \nError [ETYC0372002]: Cannot assign a non-const or invalid expression `(neg a)` to const variable `b`\n --> compiler-test:5:5\n |\n 5 | const b: i64 = -a;\n | ^^^^^^^^^^^^^^^^^\nError [EFLA0373001]: The const operation `(neg -9223372036854775808i64` causes an overflow.\n --> compiler-test:1:1\n |\n 1 | \n | \n"
- "Error [EFLA0373001]: The const operation `(neg -9223372036854775808i64)` causes an overflow.\n --> compiler-test:1:1\n |\n 1 | \n | \nError [ETYC0372002]: Cannot assign a non-const or invalid expression `(neg a)` to const variable `b`\n --> compiler-test:5:5\n |\n 5 | const b: i64 = -a;\n | ^^^^^^^^^^^^^^^^^\nError [EFLA0373001]: The const operation `(neg -9223372036854775808i64)` causes an overflow.\n --> compiler-test:1:1\n |\n 1 | \n | \n"

View File

@ -2,4 +2,4 @@
namespace: Compile
expectation: Fail
outputs:
- "Error [EFLA0373001]: The const operation `(neg -9223372036854775808i64` causes an overflow.\n --> compiler-test:1:1\n |\n 1 | \n | \nError [ETYC0372002]: Cannot assign a non-const or invalid expression `(neg a)` to const variable `b`\n --> compiler-test:5:5\n |\n 5 | const b: i64 = -a;\n | ^^^^^^^^^^^^^^^^^\nError [EFLA0373001]: The const operation `(neg -9223372036854775808i64` causes an overflow.\n --> compiler-test:1:1\n |\n 1 | \n | \n"
- "Error [EFLA0373001]: The const operation `(neg -9223372036854775808i64)` causes an overflow.\n --> compiler-test:1:1\n |\n 1 | \n | \nError [ETYC0372002]: Cannot assign a non-const or invalid expression `(neg a)` to const variable `b`\n --> compiler-test:5:5\n |\n 5 | const b: i64 = -a;\n | ^^^^^^^^^^^^^^^^^\nError [EFLA0373001]: The const operation `(neg -9223372036854775808i64)` causes an overflow.\n --> compiler-test:1:1\n |\n 1 | \n | \n"

View File

@ -2,4 +2,4 @@
namespace: Compile
expectation: Fail
outputs:
- "Error [EFLA0373001]: The const operation `(neg -128i8` causes an overflow.\n --> compiler-test:1:1\n |\n 1 | \n | \nError [ETYC0372002]: Cannot assign a non-const or invalid expression `(neg a)` to const variable `b`\n --> compiler-test:5:5\n |\n 5 | const b: i8 = -a;\n | ^^^^^^^^^^^^^^^^\nError [EFLA0373001]: The const operation `(neg -128i8` causes an overflow.\n --> compiler-test:1:1\n |\n 1 | \n | \n"
- "Error [EFLA0373001]: The const operation `(neg -128i8)` causes an overflow.\n --> compiler-test:1:1\n |\n 1 | \n | \nError [ETYC0372002]: Cannot assign a non-const or invalid expression `(neg a)` to const variable `b`\n --> compiler-test:5:5\n |\n 5 | const b: i8 = -a;\n | ^^^^^^^^^^^^^^^^\nError [EFLA0373001]: The const operation `(neg -128i8)` causes an overflow.\n --> compiler-test:1:1\n |\n 1 | \n | \n"

View File

@ -2,4 +2,4 @@
namespace: Compile
expectation: Fail
outputs:
- "Error [EFLA0373001]: The const operation `(neg -128i8` causes an overflow.\n --> compiler-test:1:1\n |\n 1 | \n | \nError [ETYC0372002]: Cannot assign a non-const or invalid expression `(neg a)` to const variable `b`\n --> compiler-test:5:5\n |\n 5 | const b: i8 = -a;\n | ^^^^^^^^^^^^^^^^\nError [EFLA0373001]: The const operation `(neg -128i8` causes an overflow.\n --> compiler-test:1:1\n |\n 1 | \n | \n"
- "Error [EFLA0373001]: The const operation `(neg -128i8)` causes an overflow.\n --> compiler-test:1:1\n |\n 1 | \n | \nError [ETYC0372002]: Cannot assign a non-const or invalid expression `(neg a)` to const variable `b`\n --> compiler-test:5:5\n |\n 5 | const b: i8 = -a;\n | ^^^^^^^^^^^^^^^^\nError [EFLA0373001]: The const operation `(neg -128i8)` causes an overflow.\n --> compiler-test:1:1\n |\n 1 | \n | \n"