[fine] Parse alternate types

This commit is contained in:
John Doty 2024-02-01 07:56:30 -08:00
parent f7acfd588d
commit afa4812074
10 changed files with 73 additions and 26 deletions

View file

@ -658,7 +658,8 @@ fn compile_new_object_expression(c: &mut Compiler, t: TreeRef, tree: &Tree) -> C
}
// Fetch the correct constructor.
let type_reference = tree.child_tree_of_kind(c.syntax, TreeKind::TypeExpression)?;
// TODO: Binding this type should be done by semantics, and we should borrow it.
let type_reference = tree.child_tree_of_kind(c.syntax, TreeKind::TypeIdentifier)?;
let identifier = type_reference.nth_token(0)?;
let environment = c.semantics.environment_of(t);
match environment.bind(identifier)? {