You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Breaking change for erasedDefinitions: this effectively makes the
current `erased` marker in parameter list apply to only the first
parameter.
def f(erased a: int, b: int)
should now be written as
def f(erased a: int, erased b: int)
type Function1 = (x: Int, erased y: Int) => Int
type Function2 = (Int, erased Int) => Int
Use refined traits for erased functions
- Function types with erased parameters are now always `ErasedFunction` refined with the correct `apply` definition,
for example:
scala.runtime.ErasedFunction {
def apply(x1: Int, erased x2: Int): Int
}
where ErasedFunction is an @experimental empty trait.
- Polymorphic functions cannot take erased parameters.
- By-name parameters cannot be erased.
- Internally, use the @ErasedParam annotation as a marker for an erased parameter.
- Parameters that are erased classes are now marked `erased` at Typer phase (with an annotation),
and in later phases, they are not taken into account when considering erasedness.
- Erased parameters/functions quotes API are changed:
- `isErased` => `erasedArgs`/`erasedParams` and `hasErasedArgs`/`hasErasedParams`
- `FunctionClass` now fails when `isErased = true`. Add `ErasedFunctionClass`.
- Added tests and test-fixes for `erasedDefinitions` feature
- Updated specs and internal syntax
- Aside, reject normal tuples with ValDefs in them. This comes up when trying to parse parameters out of tuples.
In practice they don't show up.
Co-authored-by: Nicolas Stucki <[email protected]>
0 commit comments