mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-26 21:39:07 +00:00
Typecheck and compile opaque wrapping functions
This enables you to write something like ``` A := U8 List.map [1, 2, 3] @A ``` which will be compiled as if it was `List.map [1, 2, 3] \x -> @A x`. Closes #3499
This commit is contained in:
parent
d889f1fda9
commit
f1a6ea6a40
9 changed files with 360 additions and 15 deletions
|
@ -7,7 +7,10 @@ use roc_types::subs::Variable;
|
|||
use crate::{
|
||||
abilities::AbilitiesStore,
|
||||
def::{Annotation, Declaration, Def},
|
||||
expr::{self, AccessorData, AnnotatedMark, ClosureData, Declarations, Expr, Field},
|
||||
expr::{
|
||||
self, AccessorData, AnnotatedMark, ClosureData, Declarations, Expr, Field,
|
||||
OpaqueWrapFunctionData,
|
||||
},
|
||||
pattern::{DestructType, Pattern, RecordDestruct},
|
||||
};
|
||||
|
||||
|
@ -220,6 +223,7 @@ pub fn walk_expr<V: Visitor>(visitor: &mut V, expr: &Expr, var: Variable) {
|
|||
ext_var: _,
|
||||
} => visitor.visit_expr(&loc_expr.value, loc_expr.region, *field_var),
|
||||
Expr::Accessor(AccessorData { .. }) => { /* terminal */ }
|
||||
Expr::OpaqueWrapFunction(OpaqueWrapFunctionData { .. }) => { /* terminal */ }
|
||||
Expr::Update {
|
||||
record_var: _,
|
||||
ext_var: _,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue