oden/fine/tests/expression/errors/assignment_errors.fine
John Doty 1199646e29 [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.
2024-02-15 06:36:14 -08:00

20 lines
569 B
Text

fun something() { }
fun something_else() { }
fun wrong() {
let x = 12;
let y = "hello";
x = y; // should be an error
y = x; // should be an error
let z = 23;
y = x = z; // should be an error
something_else = something; // should be an error
}
// @expect-errors:
// | __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