summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2006-08-14 16:08:35 +0000
committerMartin Odersky <odersky@gmail.com>2006-08-14 16:08:35 +0000
commitc840d9f58c3d3dd9dbb5581df86985d6600fa09a (patch)
treedd22188d2001ec5524a94cf2c7ac137a80826b61
parenta959d0cd1054396113417ae0fc29117601811d6f (diff)
downloadscala-c840d9f58c3d3dd9dbb5581df86985d6600fa09a.tar.gz
scala-c840d9f58c3d3dd9dbb5581df86985d6600fa09a.tar.bz2
scala-c840d9f58c3d3dd9dbb5581df86985d6600fa09a.zip
eliminated -Xgadt option.
-rw-r--r--src/compiler/scala/tools/nsc/Settings.scala1
-rw-r--r--src/compiler/scala/tools/nsc/typechecker/Contexts.scala18
-rw-r--r--src/compiler/scala/tools/nsc/typechecker/Namers.scala2
-rw-r--r--src/compiler/scala/tools/nsc/typechecker/Typers.scala1
4 files changed, 2 insertions, 20 deletions
diff --git a/src/compiler/scala/tools/nsc/Settings.scala b/src/compiler/scala/tools/nsc/Settings.scala
index 7f6c5f1a51..84ef4a0ffd 100644
--- a/src/compiler/scala/tools/nsc/Settings.scala
+++ b/src/compiler/scala/tools/nsc/Settings.scala
@@ -116,7 +116,6 @@ class Settings(error: String => unit) {
val Xdce = BooleanSetting("-Xdce", "Perform dead code elimination")
val Xshowcls = StringSetting ("-Xshowcls", "class", "Show class info", "")
val Xshowobj = StringSetting ("-Xshowobj", "object", "Show object info", "")
- val Xgadt = BooleanSetting("-Xgadt", "enable gadt for classes")
val Xlinearizer = ChoiceSetting ("-Xlinearizer", "Linearizer to use", List("normal", "dfs", "rpo", "dump"), "rpo")
val Xgenerics = BooleanSetting("-Xgenerics", "Use generic Java types");
val Xprintpos = BooleanSetting("-Xprintpos", "Print tree positions (as offsets)");
diff --git a/src/compiler/scala/tools/nsc/typechecker/Contexts.scala b/src/compiler/scala/tools/nsc/typechecker/Contexts.scala
index 82c12f7e4b..383d22a447 100644
--- a/src/compiler/scala/tools/nsc/typechecker/Contexts.scala
+++ b/src/compiler/scala/tools/nsc/typechecker/Contexts.scala
@@ -102,7 +102,7 @@ trait Contexts requires Analyzer {
tree match {
case Template(_, _) | PackageDef(_, _) =>
c.enclClass = c;
- c.prefix = skolemizedThisType(this.tree, this.prefix, c.owner)
+ c.prefix = c.owner.thisType
c.inConstructorSuffix = false
case _ =>
c.enclClass = this.enclClass
@@ -178,22 +178,6 @@ trait Contexts requires Analyzer {
c
}
- def skolemizedThisType(encl: Tree, pre: Type, clazz: Symbol): Type = if (settings.Xgadt.value) {
- encl match {
- case ClassDef(_, _, tparamdefs, _, _) =>
- System.out.println("sktt " + clazz)
- if (!tparamdefs.isEmpty || pre.isInstanceOf[SingleType]) {
- val tparams = clazz.unsafeTypeParams
- val tskolems = tparamdefs map (.symbol)
- System.out.println("sktt2 " + tparams + " " + tskolems)
- val self = clazz.newThisSkolem setInfo clazz.typeOfThis.substSym(tparams, tskolems)
- singleType(pre, self)
- } else clazz.thisType
- case _ =>
- clazz.thisType
- }
- } else clazz.thisType
-
def error(pos: int, msg: String): unit =
if (reportGeneralErrors)
unit.error(pos, if (checking) "**** ERROR DURING INTERNAL CHECKING ****\n" + msg else msg)
diff --git a/src/compiler/scala/tools/nsc/typechecker/Namers.scala b/src/compiler/scala/tools/nsc/typechecker/Namers.scala
index 42f073402e..74784bb9aa 100644
--- a/src/compiler/scala/tools/nsc/typechecker/Namers.scala
+++ b/src/compiler/scala/tools/nsc/typechecker/Namers.scala
@@ -212,7 +212,7 @@ trait Namers requires Analyzer {
if (!tparams.isEmpty) {
new Namer(context.makeNewScope(tree, tree.symbol)).enterSyms(tparams);
ltype = new LazyPolyType(tparams map (.symbol), ltype);
- if (tree.symbol.isTerm || settings.Xgadt.value) skolemize(tparams);
+ if (tree.symbol.isTerm) skolemize(tparams);
}
tree.symbol.setInfo(ltype);
}
diff --git a/src/compiler/scala/tools/nsc/typechecker/Typers.scala b/src/compiler/scala/tools/nsc/typechecker/Typers.scala
index 93f9baafed..2132ddc7d3 100644
--- a/src/compiler/scala/tools/nsc/typechecker/Typers.scala
+++ b/src/compiler/scala/tools/nsc/typechecker/Typers.scala
@@ -701,7 +701,6 @@ trait Typers requires Analyzer {
val selfType =
if (clazz.isAnonymousClass && !phase.erasedTypes)
intersectionType(clazz.info.parents, clazz.owner)
- else if (settings.Xgadt.value) clazz.typeOfThis.asSeenFrom(context.prefix, clazz)
else clazz.typeOfThis
// the following is necessary for templates generated later
new Namer(context.outer.make(templ, clazz, clazz.info.decls)).enterSyms(templ.body)