[fine] File name in error messages

Going to need to normalize that name though, because right now it
really *really* sucks to have a big \\?\ kinda name. Probably
normalize it relative to the base directory.
This commit is contained in:
John Doty 2024-02-15 06:36:14 -08:00
parent a21f18da6e
commit 1199646e29
16 changed files with 52 additions and 34 deletions

View file

@ -14,7 +14,7 @@ fun wrong() {
}
// @expect-errors:
// | 7:4: cannot assign a value of type 'string' to type 'f64'
// | 8:4: cannot assign a value of type 'f64' to type 'string'
// | 11:4: cannot assign a value of type 'f64' to type 'string'
// | 13:2: cannot assign a new value to a function declaration
// | __test__:7:4: cannot assign a value of type 'string' to type 'f64'
// | __test__:8:4: cannot assign a value of type 'f64' to type 'string'
// | __test__:11:4: cannot assign a value of type 'f64' to type 'string'
// | __test__:13:2: cannot assign a new value to a function declaration

View file

@ -4,4 +4,4 @@ fun test() {
// NOTE: These errors should be better
// @expect-errors:
// | 2:10: Error at 'true': expected a block after `if`
// | __test__:2:10: Error at 'true': expected a block after `if`

View file

@ -5,4 +5,4 @@ fun test() -> f64 {
}
// @expect-errors:
// | 4:6: cannot apply binary operator '+' to expressions of type 'class Foo' (on the left) and 'f64' (on the right)
// | __test__:4:6: cannot apply binary operator '+' to expressions of type 'class Foo' (on the left) and 'f64' (on the right)

View file

@ -4,4 +4,4 @@ class Foo {
}
// @expect-errors:
// | 3:2: duplicate definition of field 'x'
// | __test__:3:2: duplicate definition of field 'x'

View file

@ -16,9 +16,9 @@ fun test() {
}
// @expect-errors:
// | 7:12: missing an initializer for field y
// | 8:12: missing an initializer for field x
// | 9:41: Point instance does not have a field named z
// | 10:32: field x is of type f64, but this expression generates a string
// | 12:32: cannot find value x here
// | 15:31: field x is of type f64, but this expression generates a string
// | __test__:7:12: missing an initializer for field y
// | __test__:8:12: missing an initializer for field x
// | __test__:9:41: Point instance does not have a field named z
// | __test__:10:32: field x is of type f64, but this expression generates a string
// | __test__:12:32: cannot find value x here
// | __test__:15:31: field x is of type f64, but this expression generates a string

View file

@ -1,4 +1,4 @@
fun something(x: f64, x: f64) {}
// @expect-errors:
// | 1:22: duplicate definition of parameter 'x'
// | __test__:1:22: duplicate definition of parameter 'x'

View file

@ -11,6 +11,6 @@ class Bar {}
class Bar {}
// @expect-errors:
// | 3:2: duplicate definition of function 'foo'
// | 8:0: duplicate definition of function 'nested'
// | 11:0: duplicate definition of class 'Bar'
// | __test__:3:2: duplicate definition of function 'foo'
// | __test__:8:0: duplicate definition of function 'nested'
// | __test__:11:0: duplicate definition of class 'Bar'

View file

@ -1,4 +1,4 @@
if 23 { "what" } else { "the" }
// @expect-errors:
// | 1:3: this condition produces 'f64', but must produce bool
// | __test__:1:3: this condition produces 'f64', but must produce bool

View file

@ -1,4 +1,4 @@
if (if false { true }) { 32 } else { 23 }
// @expect-errors:
// | 1:3: this condition produces 'nothing or bool', but must produce bool
// | __test__:1:3: this condition produces 'nothing or bool', but must produce bool

View file

@ -9,4 +9,4 @@ fun foo() -> f64 {
}
// @expect-errors:
// | 8:2: cannot find value y here
// | __test__:8:2: cannot find value y here

View file

@ -8,4 +8,4 @@ fun test() {
}
// @expect-errors:
// | 7:6: methods cannot be assigned to variables
// | __test__:7:6: methods cannot be assigned to variables

View file

@ -6,4 +6,4 @@ fun test() -> f64 {
}
// @expect-errors:
// | 3:4: callers of this function expect a value of type 'f64' but this statement returns a value of type 'string'
// | __test__:3:4: callers of this function expect a value of type 'f64' but this statement returns a value of type 'string'

View file

@ -3,4 +3,4 @@ fun test() {
}
// @expect-errors:
// | 2:8: this condition produces 'f64', but must produce bool
// | __test__:2:8: this condition produces 'f64', but must produce bool

View file

@ -8,5 +8,5 @@ fun test() {
}
// @expect-errors:
// | 7:12: Error at '{': expected an identifier after a '.' in member access
// | 7:26: cannot find value foo here
// | __test__:7:12: Error at '{': expected an identifier after a '.' in member access
// | __test__:7:26: cannot find value foo here