Created
March 4, 2016 19:04
-
-
Save fizzy33/d0b6ea13e8c3086470c5 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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