Initial implementation of tuples in type checking

This leaves in place a bunch of TODOs and likely many bugs - notably, I haven't tested codegen/layout at all here.
This commit is contained in:
Joshua Warner 2022-12-25 19:26:32 -08:00
parent d57cb50425
commit de828416bf
No known key found for this signature in database
GPG key ID: 89AD497003F93FDD
32 changed files with 1785 additions and 112 deletions

View file

@ -1469,6 +1469,26 @@ mod solve_expr {
infer_eq("{ x: 5, y : 3.14 }.x", "Num *");
}
#[test]
fn record_literal_accessor_function() {
infer_eq(".x { x: 5, y : 3.14 }", "Num *");
}
#[test]
fn tuple_literal_accessor() {
infer_eq("(5, 3.14 ).0", "Num *");
}
#[test]
fn tuple_literal_accessor_function() {
infer_eq(".0 (5, 3.14 )", "Num *");
}
#[test]
fn tuple_literal_ty() {
infer_eq("(5, 3.14 )", "( Num *, Float * )*");
}
#[test]
fn record_arg() {
infer_eq("\\rec -> rec.x", "{ x : a }* -> a");