Skip to content

Remove unnececary boxing in a.synchronized(1) #505

Closed
@DarkDimius

Description

@DarkDimius

Both Scalac and Dotty assume that synchronized takes and returns an Object after erasure.
Actually it doesn't so there's no need to box.
We could potentially leave synchronized as a polymorphic method after erasure and save a bit on GC pressure and bytecode size.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions