Recently encountered such an error where I forgot to add a ',' after the name field but the compiler complains and highlights the wrong position where the error occurred. The error message is accurate in my opinion.
main.buzz:18:9: [E74] Syntax error: Expected `,` after field initialization.
16 ╭─ name = "Vincent",
17 │ age = 21
18 │ height = 5.5,
┆ ╭─────
┆ ╰─ Expected `,` after field initialization.
19 │ };
20 ╰─ print("Hello, I'm {me.name} and I'm {me.age} years old");
Is this intentional? I think the underline should be at the end, on the line where the comma is missing, possibly underlining the value assigned to the field or maybe even underline the entire line.
15 ╭─ Person me = Person {
16 │ name = "Vincent"
17 │ age = 21,
┆ ╭──
┆ ╰─ Expected `,` after field initialization.
18 │ height = 5.5,
19 ╰─ };
When I remove it on the first field the error get reported on the second field? why? The same thing happens when you are missing a ';'. The error message is still correct but the underline is out of place.
main.buzz:23:5: [E74] Syntax error: Expected `;` after expression.
21 ╭─ me.age = me.growUp();
22 │ me = Person{name = "Kelly"}
23 │ print("Hello, I'm {me.name} and I'm {me.age} years old");
┆ ╭────
┆ ╰─ Expected `;` after expression.
24 │ }
25 ╰─
Recently encountered such an error where I forgot to add a ',' after the name field but the compiler complains and highlights the wrong position where the error occurred. The error message is accurate in my opinion.
Is this intentional? I think the underline should be at the end, on the line where the comma is missing, possibly underlining the value assigned to the field or maybe even underline the entire line.
When I remove it on the first field the error get reported on the second field? why? The same thing happens when you are missing a ';'. The error message is still correct but the underline is out of place.