diff options
author | Dmitry Petrashko <dmitry.petrashko@gmail.com> | 2015-06-25 09:39:15 +0200 |
---|---|---|
committer | Dmitry Petrashko <dmitry.petrashko@gmail.com> | 2015-07-13 15:31:15 +0200 |
commit | d8985603b5d670414ea7844a628168f92a09c402 (patch) | |
tree | d024e3b6ceea68c62764faaead372a6b2af36c4a /src/dotty/tools/dotc/core/NameOps.scala | |
parent | c76d63da11e8456422c0bd0fd3e38cfdad049e50 (diff) | |
download | dotty-d8985603b5d670414ea7844a628168f92a09c402.tar.gz dotty-d8985603b5d670414ea7844a628168f92a09c402.tar.bz2 dotty-d8985603b5d670414ea7844a628168f92a09c402.zip |
SpecializeNames: Duplicate scalac behaviour, sort tparams
Diffstat (limited to 'src/dotty/tools/dotc/core/NameOps.scala')
-rw-r--r-- | src/dotty/tools/dotc/core/NameOps.scala | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/dotty/tools/dotc/core/NameOps.scala b/src/dotty/tools/dotc/core/NameOps.scala index 4d6cca61d..74555961e 100644 --- a/src/dotty/tools/dotc/core/NameOps.scala +++ b/src/dotty/tools/dotc/core/NameOps.scala @@ -236,7 +236,7 @@ object NameOps { case nme.clone_ => nme.clone_ } - def specializedFor(returnType: Types.Type, args: List[Types.Type])(implicit ctx: Context): name.ThisName = { + def specializedFor(classTargs: List[Types.Type], classTargsNames: List[Name], methodTargs: List[Types.Type], methodTarsNames: List[Name])(implicit ctx: Context): name.ThisName = { def typeToTag(tp: Types.Type): Name = { tp.classSymbol match { @@ -253,9 +253,12 @@ object NameOps { } } + val methodTags: Seq[Name] = (methodTargs zip methodTarsNames).sortBy(_._2).map(x => typeToTag(x._1)) + val classTags: Seq[Name] = (classTargs zip classTargsNames).sortBy(_._2).map(x => typeToTag(x._1)) + name.fromName(name ++ nme.specializedTypeNames.prefix ++ - args.map(typeToTag).foldRight(typeToTag(returnType))(_ ++ _) ++ - nme.specializedTypeNames.suffix) + methodTags.fold(nme.EMPTY)(_ ++ _) ++ nme.specializedTypeNames.separator ++ + classTags.fold(nme.EMPTY)(_ ++ _) ++ nme.specializedTypeNames.suffix) } /** If name length exceeds allowable limit, replace part of it by hash */ |