Skip to content

names of anonymous functions generated as annotation arguments are not unique #15054

Closed
@bertlebee

Description

@bertlebee

Compiler version

3.1.1

Minimized code

https://scastie.scala-lang.org/JyCTJBMCRIKW73xNmAuaLA

import scala.annotation.Annotation

class AnAnnotation(function: Int => String) extends Annotation

@AnAnnotation(_.toString)
val a = 1
@AnAnnotation(_.toString.length.toString)
val b = 2

Output

Double definition:
def $anonfun(_$2: Int): String in object Playground at line 9 and
def $anonfun(_$1: Int): String in object Playground at line 7

Expectation

generated anonymous functions should have unique names

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions