Add failing test

This commit is contained in:
Greg Shuflin 2021-11-26 02:11:18 -08:00
parent 1470e7fbdd
commit 9d9331f4b0
2 changed files with 18 additions and 1 deletions

View File

@ -616,8 +616,8 @@ fn primary_expr_no_struct(input: Span) -> ParseResult<ExpressionKind> {
bool_literal,
float_literal,
number_literal,
string_literal,
self_expr,
string_literal,
)),
)(input)
}

View File

@ -270,3 +270,20 @@ fn duplicate_struct_members() {
] if type_name == &Fqsn::from_strs(&["Tarak", "Tarak"]) && member == "mets"
);
}
#[test]
fn methods() {
let source = r#"
type Foo = { x: Int, y: Int }
impl Foo {
fn hella() {
self.x + 50
}
}
"#;
let (symbols, _) = add_symbols(source);
symbols.debug();
assert!(symbols.fq_names.table.get(&make_fqsn(&["hella"])).is_some());
}