aboutsummaryrefslogtreecommitdiff
path: root/src/dotty/tools/dotc/core/NameOps.scala
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2013-03-18 22:05:26 +0100
committerMartin Odersky <odersky@gmail.com>2013-03-18 22:05:26 +0100
commiteb2b6bf420b24ac0307e17fc9fec38e91012d1af (patch)
treea49d5b4f45f78ec96006b18816b69ed30c8a745e /src/dotty/tools/dotc/core/NameOps.scala
parent830e511b6b620716d3f550a199d0a5c52c95423a (diff)
downloaddotty-eb2b6bf420b24ac0307e17fc9fec38e91012d1af.tar.gz
dotty-eb2b6bf420b24ac0307e17fc9fec38e91012d1af.tar.bz2
dotty-eb2b6bf420b24ac0307e17fc9fec38e91012d1af.zip
More changes for higher-kinded types emulation.
Diffstat (limited to 'src/dotty/tools/dotc/core/NameOps.scala')
-rw-r--r--src/dotty/tools/dotc/core/NameOps.scala8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/dotty/tools/dotc/core/NameOps.scala b/src/dotty/tools/dotc/core/NameOps.scala
index e83278814..1045d0de9 100644
--- a/src/dotty/tools/dotc/core/NameOps.scala
+++ b/src/dotty/tools/dotc/core/NameOps.scala
@@ -83,6 +83,14 @@ object NameOps {
name.last == '=' && name.head != '=' && isOperatorPart(name.head)
}
+ /** Is this the name of a higher-kinded type parameter? */
+ def isHkParamName: Boolean = name(0) == '_' && name.startsWith(HK_PARAM_PREFIX)
+
+ /** The index of the higher-kinded type parameter with this name.
+ * Pre: isHkParamName.
+ */
+ def hkParamIndex: Int = name.drop(name.lastIndexOf('$') + 1).toString.toInt
+
/** If the name ends with $nn where nn are
* all digits, strip the $ and the digits.
* Otherwise return the argument.