Skip to content

Instantly share code, notes, and snippets.

@fizzy33
Created March 4, 2016 19:04
Show Gist options
  • Save fizzy33/d0b6ea13e8c3086470c5 to your computer and use it in GitHub Desktop.
Save fizzy33/d0b6ea13e8c3086470c5 to your computer and use it in GitHub Desktop.
object SourcecodeNameBug extends App {
val x1 = new Foo {}
val x2 = new Foo {}
abstract class Foo(implicit name: sourcecode.Name) {
override def toString = name.value
}
println(x1)
println(x2)
}
/*
outputs (using scala 2.11.7)
<init>
<init>
*/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment