aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2017-04-06 14:58:20 +0200
committerMartin Odersky <odersky@gmail.com>2017-04-11 09:33:12 +0200
commitb17af4b7abfa1de2a0099329a7e7148cabafbab0 (patch)
tree6fc3a2cae920fbf619a4556f829c4b713a5f66ca
parent868a6a1025781eeac3eb884040639119542b3f49 (diff)
downloaddotty-b17af4b7abfa1de2a0099329a7e7148cabafbab0.tar.gz
dotty-b17af4b7abfa1de2a0099329a7e7148cabafbab0.tar.bz2
dotty-b17af4b7abfa1de2a0099329a7e7148cabafbab0.zip
Fix rebase breakage
-rw-r--r--compiler/src/dotty/tools/dotc/core/Flags.scala2
-rw-r--r--compiler/src/dotty/tools/dotc/core/NameKinds.scala1
-rw-r--r--compiler/src/dotty/tools/dotc/core/NameOps.scala23
-rw-r--r--compiler/src/dotty/tools/dotc/core/StdNames.scala2
4 files changed, 6 insertions, 22 deletions
diff --git a/compiler/src/dotty/tools/dotc/core/Flags.scala b/compiler/src/dotty/tools/dotc/core/Flags.scala
index ef3261719..84072cd50 100644
--- a/compiler/src/dotty/tools/dotc/core/Flags.scala
+++ b/compiler/src/dotty/tools/dotc/core/Flags.scala
@@ -452,7 +452,7 @@ object Flags {
final val FromStartFlags =
Module | Package | Deferred | MethodOrHKCommon | Param | ParamAccessor |
Scala2ExistentialCommon | Mutable.toCommonFlags | InSuperCall | Touched | JavaStatic |
- CovariantOrOuter | ContravariantOrLabel | ExpandedName | CaseAccessorOrBaseTypeArg |
+ CovariantOrOuter | ContravariantOrLabel | CaseAccessorOrBaseTypeArg |
Fresh | Frozen | Erroneous | ImplicitCommon | Permanent | Synthetic |
SuperAccessorOrScala2x | Inline
diff --git a/compiler/src/dotty/tools/dotc/core/NameKinds.scala b/compiler/src/dotty/tools/dotc/core/NameKinds.scala
index cda6e0c83..c34a100a8 100644
--- a/compiler/src/dotty/tools/dotc/core/NameKinds.scala
+++ b/compiler/src/dotty/tools/dotc/core/NameKinds.scala
@@ -252,7 +252,6 @@ object NameKinds {
object VariantName extends NumberedNameKind(VARIANT, "Variant") {
val varianceToPrefix = Map(-1 -> '-', 0 -> '=', 1 -> '+')
- val prefixToVariance = Map('-' -> -1, '=' -> 0, '+' -> 1)
def mkString(underlying: TermName, info: ThisInfo) = {
varianceToPrefix(info.num).toString + underlying
}
diff --git a/compiler/src/dotty/tools/dotc/core/NameOps.scala b/compiler/src/dotty/tools/dotc/core/NameOps.scala
index 27bd3a05e..915bd52ab 100644
--- a/compiler/src/dotty/tools/dotc/core/NameOps.scala
+++ b/compiler/src/dotty/tools/dotc/core/NameOps.scala
@@ -126,33 +126,16 @@ object NameOps {
def errorName: N = likeSpaced(name ++ nme.ERROR)
-/*
+
/** Name with variance prefix: `+` for covariant, `-` for contravariant */
def withVariance(v: Int): N =
- if (hasVariance) dropVariance.withVariance(v)
- else v match {
- case -1 => likeTyped('-' +: name)
- case 1 => likeTyped('+' +: name)
- case 0 => name
- }
-
- /** Does name have a `+`/`-` variance prefix? */
- def hasVariance: Boolean =
- name.nonEmpty && name.head == '+' || name.head == '-'
-
- /** Drop variance prefix if name has one */
- def dropVariance: N = if (hasVariance) likeTyped(name.tail) else name
+ likeSpaced { VariantName(name.exclude(VariantName).toTermName, v) }
/** The variance as implied by the variance prefix, or 0 if there is
* no variance prefix.
*/
- def variance = name.head match {
- case '-' => -1
- case '+' => 1
- case _ => 0
- }
+ def variance = name.collect { case VariantName(_, n) => n }.getOrElse(0)
-*/
def freshened(implicit ctx: Context): N = likeSpaced {
name.toTermName match {
case ModuleClassName(original) => ModuleClassName(original.freshened)
diff --git a/compiler/src/dotty/tools/dotc/core/StdNames.scala b/compiler/src/dotty/tools/dotc/core/StdNames.scala
index 9272c32ed..306a84589 100644
--- a/compiler/src/dotty/tools/dotc/core/StdNames.scala
+++ b/compiler/src/dotty/tools/dotc/core/StdNames.scala
@@ -122,6 +122,8 @@ object StdNames {
val DEFAULT_GETTER: N = str.DEFAULT_GETTER
val DEFAULT_GETTER_INIT: N = "$lessinit$greater"
val DO_WHILE_PREFIX: N = "doWhile$"
+ val DOLLAR_VALUES: N = "$values"
+ val DOLLAR_NEW: N = "$new"
val EMPTY: N = ""
val EMPTY_PACKAGE: N = Names.EMPTY_PACKAGE.toString
val EXCEPTION_RESULT_PREFIX: N = "exceptionResult"