Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

SI-6715 Shouldn't return "" from TermNames.originalName

  • Loading branch information...
commit 5f9bc0570f0e2fc4a80eee592bf2eb3eaddf1390 1 parent 8e83703
@kzys kzys authored
View
2  src/reflect/scala/reflect/internal/StdNames.scala
@@ -382,7 +382,7 @@ trait StdNames {
* Otherwise `name` itself.
*/
def originalName(name: Name): Name = name.toString lastIndexOf "$$" match {
- case -1 => name
+ case -1 | 0 => name
case idx0 =>
// Sketchville - We've found $$ but if it's part of $$$ or $$$$
// or something we need to keep the bonus dollars, so e.g. foo$$$outer
View
15 test/files/run/t6715.scala
@@ -0,0 +1,15 @@
+import scala.reflect.runtime.universe._
+
+class A {
+ def $$ = 1
+ def $times = 1
+}
+
+object Test {
+ def main(args: Array[String]): Unit = {
+ val memberSet: Set[String] = typeOf[A].members.map{ _.toString }.toSet
+ assert(memberSet contains "method *")
+ assert(memberSet contains "method $$")
+ assert(! (memberSet contains "method"))
+ }
+}
View
1  test/scaladoc/run/SI-6715.check
@@ -0,0 +1 @@
+Done.
View
15 test/scaladoc/run/SI-6715.scala
@@ -0,0 +1,15 @@
+import scala.tools.nsc.doc.model._
+import scala.tools.partest.ScaladocModelTest
+
+object Test extends ScaladocModelTest {
+ def scaladocSettings = ""
+
+ override def code = "object A { def $$ = 123 }"
+
+ def testModel(rootPackage: Package) = {
+ import access._
+
+ val method = rootPackage._object("A")._method("$$")
+ assert(method != null)
+ }
+}
Please sign in to comment.
Something went wrong with that request. Please try again.