Commit message (Collapse) | Author | Age | Files | Lines | |
---|---|---|---|---|---|
* | Keep Function when CBN arg thunk targets a SAM | Adriaan Moors | 2016-03-30 | 1 | -0/+9 |
The body of `def delay[T](v: => T) = (v _): F0[T]` becomes `() => v` during `typedEta`, and then uncurry considers whether to strip the function wrapper since `v` is known to be a `Function0` thunk. Stripping is sound when the expected type is `Function0` for this expression, but that's no longer a given, since we could be expecting any nullary SAM. Also sweep up a bit around `typedEta`. Encapsulate the, erm, creative encoding of `m _` as `Typed(m, Function(Nil, EmptyTree))`. |