diff options
8 files changed, 19 insertions, 34 deletions
diff --git a/src/compiler/scala/tools/nsc/symtab/classfile/Pickler.scala b/src/compiler/scala/tools/nsc/symtab/classfile/Pickler.scala index b57f89c020..0940598bd2 100644 --- a/src/compiler/scala/tools/nsc/symtab/classfile/Pickler.scala +++ b/src/compiler/scala/tools/nsc/symtab/classfile/Pickler.scala @@ -582,12 +582,12 @@ abstract class Pickler extends SubComponent { case ClassInfoType(parents, decls, clazz) => writeRef(clazz); writeRefs(parents); CLASSINFOtpe case mt @ MethodType(formals, restpe) => - writeRef(restpe); writeRefs(formals) - if (mt.isImplicit) IMPLICITMETHODtpe - else METHODtpe - case mt @ NullaryMethodType(restpe) => // reuse POLYtpe since those can never have an empty list of tparams -- TODO: is there any way this can come back and bite us in the bottom? - // ugliness and thrift aside, this should make this somewhat more backward compatible - // (I'm not sure how old scalac's would deal with nested PolyTypes, as these used to be folded into one) + writeRef(restpe); writeRefs(formals) ; METHODtpe + case mt @ NullaryMethodType(restpe) => + // reuse POLYtpe since those can never have an empty list of tparams. + // TODO: is there any way this can come back and bite us in the bottom? + // ugliness and thrift aside, this should make this somewhat more backward compatible + // (I'm not sure how old scalac's would deal with nested PolyTypes, as these used to be folded into one) writeRef(restpe); writeRefs(Nil); POLYtpe case PolyType(tparams, restpe) => // invar: tparams nonEmpty writeRef(restpe); writeRefs(tparams); POLYtpe @@ -1037,8 +1037,7 @@ abstract class Pickler extends SubComponent { case ClassInfoType(parents, decls, clazz) => print("CLASSINFOtpe "); printRef(clazz); printRefs(parents); case mt @ MethodType(formals, restpe) => - print(if (mt.isImplicit) "IMPLICITMETHODtpe " else "METHODtpe "); - printRef(restpe); printRefs(formals) + print("METHODtpe"); printRef(restpe); printRefs(formals) case PolyType(tparams, restpe) => print("POLYtpe "); printRef(restpe); printRefs(tparams); case ExistentialType(tparams, restpe) => diff --git a/src/compiler/scala/tools/nsc/transform/LiftCode.scala b/src/compiler/scala/tools/nsc/transform/LiftCode.scala index ad6ccaff59..b52419f7ca 100644 --- a/src/compiler/scala/tools/nsc/transform/LiftCode.scala +++ b/src/compiler/scala/tools/nsc/transform/LiftCode.scala @@ -51,9 +51,6 @@ abstract class LiftCode extends Transform with Reifiers { def className(value: AnyRef): String = value match { case _ :: _ => "scala.$colon$colon" case reflect.MethodType(_, _) => - if (value.isInstanceOf[reflect.ImplicitMethodType]) - "scala.reflect.ImplicitMethodType" - else "scala.reflect.MethodType" case x:Product => "scala.reflect."+x.productPrefix //caseName diff --git a/src/compiler/scala/tools/nsc/util/ShowPickled.scala b/src/compiler/scala/tools/nsc/util/ShowPickled.scala index 476e0944cd..a8499fc6a7 100644 --- a/src/compiler/scala/tools/nsc/util/ShowPickled.scala +++ b/src/compiler/scala/tools/nsc/util/ShowPickled.scala @@ -76,7 +76,7 @@ object ShowPickled extends Names { case CLASSINFOtpe => "CLASSINFOtpe" case METHODtpe => "METHODtpe" case POLYtpe => "POLYtpe" - case IMPLICITMETHODtpe => "IMPLICITMETHODtpe" + case IMPLICITMETHODtpe => "METHODtpe" // IMPLICITMETHODtpe no longer used. case SUPERtpe => "SUPERtpe" case LITERALunit => "LITERALunit" case LITERALboolean => "LITERALboolean" diff --git a/src/library/scala/reflect/Type.scala b/src/library/scala/reflect/Type.scala index 85b047d97c..5aa92b3828 100644 --- a/src/library/scala/reflect/Type.scala +++ b/src/library/scala/reflect/Type.scala @@ -6,12 +6,8 @@ ** |/ ** \* */ - - package scala.reflect -import collection.immutable.List - /** This type is required by the compiler and <b>should not be used in client code</b>. */ abstract class Type @@ -55,13 +51,6 @@ case class NullaryMethodType(resultType: Type) extends Type /** This type is required by the compiler and <b>should not be used in client code</b>. */ case class PolyType(typeParams: List[Symbol], typeBounds: List[(Type, Type)], resultType: Type) extends Type - -/** This type is required by the compiler and <b>should not be used in client code</b>. */ -class ImplicitMethodType(formals: List[Symbol], restpe: Type) -extends MethodType(formals, restpe) - - - /* Standard pattern match: case reflect.NoPrefix => @@ -72,7 +61,7 @@ extends MethodType(formals, restpe) case reflect.ThisType(clazz) => case reflect.AppliedType(tpe, args) => case reflect.TypeBounds(lo, hi) => - case reflect.MethodType(formals, restpe) => //can also be ImplicitMethodType + case reflect.MethodType(formals, restpe) => case reflect.NullaryMethodType(restpe) => case reflect.PolyType(typeParams, typeBounds, resultType) => */ diff --git a/src/library/scala/reflect/generic/PickleFormat.scala b/src/library/scala/reflect/generic/PickleFormat.scala index a1f988a22d..1667e8c24f 100755 --- a/src/library/scala/reflect/generic/PickleFormat.scala +++ b/src/library/scala/reflect/generic/PickleFormat.scala @@ -137,7 +137,7 @@ object PickleFormat { final val CLASSINFOtpe = 19 final val METHODtpe = 20 final val POLYtpe = 21 - final val IMPLICITMETHODtpe = 22 + final val IMPLICITMETHODtpe = 22 // no longer generated final val LITERAL = 23 // base line for literals final val LITERALunit = 24 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 |