oden/fine/tests/expression/errors/wild_member_access.fine

22 lines
669 B
Text

class Foo {
foo: f64;
}
fun test() {
let f = new Foo { foo: 12 };
let z = f.{let y = 222; foo };
}
// NOTE: The AST allows for generic expressions to the right of the dot.
// We need to make sure things are parsed correctly.
//
// TODO: Better parser recovery will improve the specifics of the errors.
//
// TODO: This is parsed wrong; the `{` is consumed after the '.' and it
// should instead be ignored. This is the "greedy" expression parsing that
// matklad talks about in his resilient parser article.
//
// @expect-errors:
// | 7:12: Error at '{': expected an expression
// | 7:26: cannot find value foo here
// | 8:0: Error at '}': unbalanced '}'