summaryrefslogtreecommitdiff
path: root/src/scalap/scala
diff options
context:
space:
mode:
authorPaul Phillips <paulp@improving.org>2011-04-11 05:01:17 +0000
committerPaul Phillips <paulp@improving.org>2011-04-11 05:01:17 +0000
commit112dc4f2a8fca6fb1a692a9891713eff5a32cb1f (patch)
treea4c759590d738db5ad693d54702b5347aa8ff0d8 /src/scalap/scala
parent6b7ff287fcd56109d1db51ff82fce0ed0cdbcca6 (diff)
downloadscala-112dc4f2a8fca6fb1a692a9891713eff5a32cb1f.tar.gz
scala-112dc4f2a8fca6fb1a692a9891713eff5a32cb1f.tar.bz2
scala-112dc4f2a8fca6fb1a692a9891713eff5a32cb1f.zip
Found there was still all kinds of detritus rem...
Found there was still all kinds of detritus remaining from the deceased IMPLICITMETHODtpe and ImplicitMethodType. Applied wrecking ball, review by moors. (Can I do the same thing with DEBRUIJNINDEXtpe and DeBruijnIndex?)
Diffstat (limited to 'src/scalap/scala')
-rw-r--r--src/scalap/scala/tools/scalap/scalax/rules/scalasig/ScalaSig.scala6
-rw-r--r--src/scalap/scala/tools/scalap/scalax/rules/scalasig/ScalaSigPrinter.scala11
-rw-r--r--src/scalap/scala/tools/scalap/scalax/rules/scalasig/Type.scala1
3 files changed, 9 insertions, 9 deletions
diff --git a/src/scalap/scala/tools/scalap/scalax/rules/scalasig/ScalaSig.scala b/src/scalap/scala/tools/scalap/scalax/rules/scalasig/ScalaSig.scala
index 170a9a15a3..995c629b5d 100644
--- a/src/scalap/scala/tools/scalap/scalax/rules/scalasig/ScalaSig.scala
+++ b/src/scalap/scala/tools/scalap/scalax/rules/scalasig/ScalaSig.scala
@@ -253,9 +253,11 @@ object ScalaSigEntryParsers extends RulesWithState with MemoisableRules {
18 -~ classSymRef ~ (typeRef*) ^~^ RefinedType,
19 -~ symbolRef ~ (typeRef*) ^~^ ClassInfoType,
20 -~ typeRef ~ (symbolRef*) ^~^ MethodType,
- 21 -~ typeRef ~ (refTo(typeSymbol)+) ^~^ PolyType, // TODO: make future safe for past by doing the same transformation as in the full unpickler in case we're reading pre-2.9 classfiles
+ 21 -~ typeRef ~ (refTo(typeSymbol)+) ^~^ PolyType,
+ // TODO: make future safe for past by doing the same transformation as in the
+ // full unpickler in case we're reading pre-2.9 classfiles
21 -~ typeRef ^^ NullaryMethodType,
- 22 -~ typeRef ~ (symbolRef*) ^~^ ImplicitMethodType,
+ 22 -~ typeRef ~ (symbolRef*) ^~^ MethodType,
42 -~ typeRef ~ (attribTreeRef*) ^~^ AnnotatedType,
51 -~ typeRef ~ symbolRef ~ (attribTreeRef*) ^~~^ AnnotatedWithSelfType,
47 -~ typeLevel ~ typeIndex ^~^ DeBruijnIndexType,
diff --git a/src/scalap/scala/tools/scalap/scalax/rules/scalasig/ScalaSigPrinter.scala b/src/scalap/scala/tools/scalap/scalax/rules/scalasig/ScalaSigPrinter.scala
index acaf64df2a..93c1c7a394 100644
--- a/src/scalap/scala/tools/scalap/scalax/rules/scalasig/ScalaSigPrinter.scala
+++ b/src/scalap/scala/tools/scalap/scalax/rules/scalasig/ScalaSigPrinter.scala
@@ -205,16 +205,17 @@ class ScalaSigPrinter(stream: PrintStream, printPrivates: Boolean) {
case ms: MethodSymbol => ms.name + " : " + toString(ms.infoType)(TypeFlags(true))
case _ => "^___^"
})
+ val implicitWord = mt.paramSymbols.headOption match {
+ case Some(p) if p.isImplicit => "implicit "
+ case _ => ""
+ }
// Print parameter clauses
- print(paramEntries.mkString(
- "(" + (mt match {case _: ImplicitMethodType => "implicit "; case _ => ""})
- , ", ", ")"))
+ print(paramEntries.mkString("(" + implicitWord, ", ", ")"))
// Print result type
mt.resultType match {
case mt: MethodType => printMethodType(mt, printResult)({})
- case imt: ImplicitMethodType => printMethodType(imt, printResult)({})
case x => if (printResult) {
print(" : ");
printType(x)
@@ -225,7 +226,6 @@ class ScalaSigPrinter(stream: PrintStream, printPrivates: Boolean) {
t match {
case NullaryMethodType(resType) => if (printResult) { print(" : "); printType(resType) }
case mt@MethodType(resType, paramSymbols) => _pmt(mt)
- case mt@ImplicitMethodType(resType, paramSymbols) => _pmt(mt)
case pt@PolyType(mt, typeParams) => {
print(typeParamString(typeParams))
printMethodType(mt, printResult)({})
@@ -373,7 +373,6 @@ class ScalaSigPrinter(stream: PrintStream, printPrivates: Boolean) {
case ClassInfoTypeWithCons(symbol, typeRefs, cons) => sep + typeRefs.map(toString).
mkString(cons + " extends ", " with ", "")
- case ImplicitMethodType(resultType, _) => toString(resultType, sep)
case MethodType(resultType, _) => toString(resultType, sep)
case NullaryMethodType(resultType) => toString(resultType, sep)
diff --git a/src/scalap/scala/tools/scalap/scalax/rules/scalasig/Type.scala b/src/scalap/scala/tools/scalap/scalax/rules/scalasig/Type.scala
index 3658cb1c89..543ddbe186 100644
--- a/src/scalap/scala/tools/scalap/scalax/rules/scalasig/Type.scala
+++ b/src/scalap/scala/tools/scalap/scalax/rules/scalasig/Type.scala
@@ -20,7 +20,6 @@ case class MethodType(resultType : Type, paramSymbols : Seq[Symbol]) extends Typ
case class NullaryMethodType(resultType : Type) extends Type
case class PolyType(typeRef : Type, symbols : Seq[TypeSymbol]) extends Type
case class PolyTypeWithCons(typeRef : Type, symbols : Seq[TypeSymbol], cons: String) extends Type
-case class ImplicitMethodType(resultType : Type, paramSymbols : Seq[Symbol]) extends Type
case class AnnotatedType(typeRef : Type, attribTreeRefs : List[Int]) extends Type
case class AnnotatedWithSelfType(typeRef : Type, symbol : Symbol, attribTreeRefs : List[Int]) extends Type
case class DeBruijnIndexType(typeLevel : Int, typeIndex : Int) extends Type