Skip to content

Commit

Permalink
fix boxmap test
Browse files Browse the repository at this point in the history
The result should capture {f}, since the expression `box(f(x))` should be
translated as:

  let z = f(x) in
    let y = □ z in
      box(y)

Denoting the above term as `t`, we can see that `f ∈ cv(t)`.
  • Loading branch information
Linyxus committed Oct 3, 2022
1 parent f77436b commit 25daaa8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tests/pos-custom-args/captures/boxmap.scala
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ def box[T <: Top](x: T): Box[T] =
def map[A <: Top, B <: Top](b: Box[A])(f: A => B): Box[B] =
b[Box[B]]((x: A) => box(f(x)))

def lazymap[A <: Top, B <: Top](b: Box[A])(f: A => B): (() -> Box[B]) =
def lazymap[A <: Top, B <: Top](b: Box[A])(f: A => B): {f} (() -> Box[B]) =
() => b[Box[B]]((x: A) => box(f(x)))

def test[A <: Top, B <: Top] =
Expand Down

0 comments on commit 25daaa8

Please sign in to comment.