Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feature req: specialized singleton types and valueOf #11489

Open
lJoublanc opened this issue Apr 16, 2019 · 0 comments

Comments

Projects
None yet
1 participant
@lJoublanc
Copy link

commented Apr 16, 2019

Using 2.13-M5, it's not possible to specialize singleton types.

scala> def twice[@scala.specialized(Int) I <: Int : ValueOf]: Int = valueOf[I] * 2
           ^
       warning: type I is unused or used in non-specializable positions.
twice: [I <: Int](implicit evidence$1: ValueOf[I])Int

I think this is because ValueOf is not specialized.
In my program I can see lots of boxing in a heap trace.
It would be nice if this could indeed be specialized for the primitive types such as Int, Double etc.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.