mirror of
https://github.com/roc-lang/roc.git
synced 2025-08-03 19:58:18 +00:00
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:
parent
d57cb50425
commit
de828416bf
32 changed files with 1785 additions and 112 deletions
|
@ -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");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue