aboutsummaryrefslogtreecommitdiff
path: root/compiler/src/dotty/tools/dotc/transform
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2017-04-03 17:35:21 +0200
committerMartin Odersky <odersky@gmail.com>2017-04-11 09:33:12 +0200
commit868a6a1025781eeac3eb884040639119542b3f49 (patch)
tree813b2acd02adf8709a38825858a7bbb0941bd63c /compiler/src/dotty/tools/dotc/transform
parentd0efabf2817468c248db8a2a6d5a6c0b58747867 (diff)
downloaddotty-868a6a1025781eeac3eb884040639119542b3f49.tar.gz
dotty-868a6a1025781eeac3eb884040639119542b3f49.tar.bz2
dotty-868a6a1025781eeac3eb884040639119542b3f49.zip
Make extension method names semantic
Diffstat (limited to 'compiler/src/dotty/tools/dotc/transform')
-rw-r--r--compiler/src/dotty/tools/dotc/transform/ExtensionMethods.scala5
1 files changed, 3 insertions, 2 deletions
diff --git a/compiler/src/dotty/tools/dotc/transform/ExtensionMethods.scala b/compiler/src/dotty/tools/dotc/transform/ExtensionMethods.scala
index 64474cecd..61f32edae 100644
--- a/compiler/src/dotty/tools/dotc/transform/ExtensionMethods.scala
+++ b/compiler/src/dotty/tools/dotc/transform/ExtensionMethods.scala
@@ -16,6 +16,7 @@ import Types._, Contexts._, Constants._, Names._, NameOps._, Flags._, DenotTrans
import SymDenotations._, Symbols._, StdNames._, Annotations._, Trees._, Scopes._, Denotations._
import TypeErasure.{ valueErasure, ErasedValueType }
import TypeUtils._
+import NameKinds.{ExtMethName, UniqueExtMethName}
import util.Positions._
import Decorators._
import SymUtils._
@@ -206,11 +207,11 @@ object ExtensionMethods {
val alts = decl.alternatives
val index = alts indexOf imeth.denot
assert(index >= 0, alts + " does not contain " + imeth)
- def altName(index: Int) = (imeth.name + "$extension" + index).toTermName
+ def altName(index: Int) = UniqueExtMethName(imeth.name.asTermName, index)
altName(index) #:: ((0 until alts.length).toStream filter (index != _) map altName)
case decl =>
assert(decl.exists, imeth.name + " not found in " + imeth.owner + "'s decls: " + imeth.owner.info.decls)
- Stream((imeth.name + "$extension").toTermName)
+ Stream(ExtMethName(imeth.name.asTermName))
}
}