mirror of
https://github.com/roc-lang/roc.git
synced 2025-11-25 21:37:48 +00:00
implement mono / lowering for tuples
This commit is contained in:
parent
65f8bb3d0d
commit
5a6be05ead
42 changed files with 1773 additions and 290 deletions
|
|
@ -9,7 +9,7 @@ use roc_module::{
|
|||
use roc_region::all::Region;
|
||||
use roc_types::{
|
||||
subs::Variable,
|
||||
types::{self, AnnotationSource, PReason, PatternCategory},
|
||||
types::{self, AnnotationSource, IndexOrField, PReason, PatternCategory},
|
||||
types::{Category, Reason},
|
||||
};
|
||||
|
||||
|
|
@ -375,7 +375,7 @@ pub fn constrain_expr<'a>(
|
|||
env.pool.add(ext_type),
|
||||
);
|
||||
|
||||
let category = Category::RecordAccessor(field.as_str(env.pool).into());
|
||||
let category = Category::Accessor(IndexOrField::Field(field.as_str(env.pool).into()));
|
||||
|
||||
let record_expected = Expected::NoExpectation(record_type.shallow_clone());
|
||||
let record_con = Eq(
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@ use roc_can::num::{
|
|||
use roc_can::operator::desugar_expr;
|
||||
use roc_collections::all::MutSet;
|
||||
use roc_module::symbol::Symbol;
|
||||
use roc_parse::ident::Accessor;
|
||||
use roc_parse::{ast::Expr, pattern::PatternType};
|
||||
use roc_problem::can::{Problem, RuntimeError};
|
||||
use roc_region::all::{Loc, Region};
|
||||
|
|
@ -295,7 +296,7 @@ pub fn expr_to_expr2<'a>(
|
|||
)
|
||||
}
|
||||
|
||||
RecordAccessorFunction(field) => (
|
||||
AccessorFunction(Accessor::RecordField(field)) => (
|
||||
Expr2::Accessor {
|
||||
function_var: env.var_store.fresh(),
|
||||
record_var: env.var_store.fresh(),
|
||||
|
|
|
|||
|
|
@ -405,7 +405,7 @@ pub fn to_type2<'a>(
|
|||
|
||||
Type2::Variable(var)
|
||||
}
|
||||
Tuple { fields: _, ext: _ } => {
|
||||
Tuple { elems: _, ext: _ } => {
|
||||
todo!("tuple type");
|
||||
}
|
||||
Record { fields, ext, .. } => {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue