mirror of
https://github.com/roc-lang/roc.git
synced 2025-12-19 14:52:38 +00:00
1.1 KiB
1.1 KiB
META
description=Basic lambda capture detection during canonicalization
type=expr
SOURCE
(|x| |y| x + y)(1)(2)
EXPECTED
NIL
PROBLEMS
NIL
TOKENS
OpenRound,OpBar,LowerIdent,OpBar,OpBar,LowerIdent,OpBar,LowerIdent,OpPlus,LowerIdent,CloseRound,NoSpaceOpenRound,Int,CloseRound,NoSpaceOpenRound,Int,CloseRound,
EndOfFile,
PARSE
(e-apply
(e-apply
(e-tuple
(e-lambda
(args
(p-ident (raw "x")))
(e-lambda
(args
(p-ident (raw "y")))
(e-binop (op "+")
(e-ident (raw "x"))
(e-ident (raw "y"))))))
(e-int (raw "1")))
(e-int (raw "2")))
FORMATTED
NO CHANGE
CANONICALIZE
(e-call
(e-call
(e-lambda
(args
(p-assign (ident "x")))
(e-closure
(captures
(capture (ident "x")))
(e-lambda
(args
(p-assign (ident "y")))
(e-binop (op "add")
(e-lookup-local
(p-assign (ident "x")))
(e-lookup-local
(p-assign (ident "y")))))))
(e-num (value "1")))
(e-num (value "2")))
TYPES
(expr (type "a where [a.from_numeral : Numeral -> Try(a, [InvalidNumeral(Str)])]"))