]>
Commit | Line | Data |
---|---|---|
e9174d1e SL |
1 | pub enum Expr<'var, VAR> { |
2 | Let(Box<Expr<'var, VAR>>, | |
0531ce1d | 3 | Box<for<'v> Fn(Expr<'v, VAR>) -> Expr<'v, VAR> + 'var>) |
e9174d1e SL |
4 | } |
5 | ||
6 | pub fn add<'var, VAR> | |
7 | (a: Expr<'var, VAR>, b: Expr<'var, VAR>) -> Expr<'var, VAR> { | |
8 | loop {} | |
9 | } | |
10 | ||
0531ce1d | 11 | pub fn let_<'var, VAR, F: for<'v> Fn(Expr<'v, VAR>) -> Expr<'v, VAR>> |
e9174d1e SL |
12 | (a: Expr<'var, VAR>, b: F) -> Expr<'var, VAR> { |
13 | loop {} | |
14 | } | |
15 | ||
16 | fn main() { | |
041b39d2 XL |
17 | let ex = |x| { //~ ERROR type annotations needed |
18 | let_(add(x,x), |y| { | |
b039eaaf | 19 | let_(add(x, x), |x|x)})}; |
e9174d1e | 20 | } |