Skip to content

Commit

Permalink
'implements Serializable` moved from every [partial]function literal to
Browse files Browse the repository at this point in the history
scala.runtime.AbstractFunctionN/[X]PFLiteral base classes.
  • Loading branch information
pavelpavlov committed Feb 4, 2012
1 parent 164c81f commit 8238c94
Show file tree
Hide file tree
Showing 25 changed files with 28 additions and 28 deletions.
6 changes: 3 additions & 3 deletions src/compiler/scala/tools/nsc/transform/UnCurry.scala
Expand Up @@ -266,9 +266,9 @@ abstract class UnCurry extends InfoTransform
else {
val anonClass = owner.newAnonymousFunctionClass(fun.pos, inConstructorFlag)
def parents =
if (isFunctionType(fun.tpe)) List(abstractFunctionForFunctionType(fun.tpe), SerializableClass.tpe)
else if (isPartial && !isExhaustive) List(appliedType(PFLiteralClass.typeConstructor, targs), SerializableClass.tpe)
else if (isPartial && isExhaustive) List(appliedType(XPFLiteralClass.typeConstructor, targs), SerializableClass.tpe)
if (isFunctionType(fun.tpe)) List(abstractFunctionForFunctionType(fun.tpe))
else if (isPartial && !isExhaustive) List(appliedType(PFLiteralClass.typeConstructor, targs))
else if (isPartial && isExhaustive) List(appliedType(XPFLiteralClass.typeConstructor, targs))
else List(ObjectClass.tpe, fun.tpe, SerializableClass.tpe)

anonClass setInfo ClassInfoType(parents, newScope, anonClass)
Expand Down
2 changes: 1 addition & 1 deletion src/library/scala/runtime/AbstractFunction0.scala
Expand Up @@ -9,6 +9,6 @@

package scala.runtime

abstract class AbstractFunction0[@specialized +R] extends Function0[R] {
abstract class AbstractFunction0[@specialized +R] extends Function0[R] with Serializable {

}
2 changes: 1 addition & 1 deletion src/library/scala/runtime/AbstractFunction1.scala
Expand Up @@ -9,6 +9,6 @@

package scala.runtime

abstract class AbstractFunction1[@specialized(scala.Int, scala.Long, scala.Float, scala.Double) -T1, @specialized(scala.Unit, scala.Boolean, scala.Int, scala.Float, scala.Long, scala.Double) +R] extends Function1[T1, R] {
abstract class AbstractFunction1[@specialized(scala.Int, scala.Long, scala.Float, scala.Double) -T1, @specialized(scala.Unit, scala.Boolean, scala.Int, scala.Float, scala.Long, scala.Double) +R] extends Function1[T1, R] with Serializable {

}
2 changes: 1 addition & 1 deletion src/library/scala/runtime/AbstractFunction10.scala
Expand Up @@ -9,6 +9,6 @@

package scala.runtime

abstract class AbstractFunction10[-T1, -T2, -T3, -T4, -T5, -T6, -T7, -T8, -T9, -T10, +R] extends Function10[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, R] {
abstract class AbstractFunction10[-T1, -T2, -T3, -T4, -T5, -T6, -T7, -T8, -T9, -T10, +R] extends Function10[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, R] with Serializable {

}
2 changes: 1 addition & 1 deletion src/library/scala/runtime/AbstractFunction11.scala
Expand Up @@ -9,6 +9,6 @@

package scala.runtime

abstract class AbstractFunction11[-T1, -T2, -T3, -T4, -T5, -T6, -T7, -T8, -T9, -T10, -T11, +R] extends Function11[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, R] {
abstract class AbstractFunction11[-T1, -T2, -T3, -T4, -T5, -T6, -T7, -T8, -T9, -T10, -T11, +R] extends Function11[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, R] with Serializable {

}
2 changes: 1 addition & 1 deletion src/library/scala/runtime/AbstractFunction12.scala
Expand Up @@ -9,6 +9,6 @@

package scala.runtime

abstract class AbstractFunction12[-T1, -T2, -T3, -T4, -T5, -T6, -T7, -T8, -T9, -T10, -T11, -T12, +R] extends Function12[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, R] {
abstract class AbstractFunction12[-T1, -T2, -T3, -T4, -T5, -T6, -T7, -T8, -T9, -T10, -T11, -T12, +R] extends Function12[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, R] with Serializable {

}
2 changes: 1 addition & 1 deletion src/library/scala/runtime/AbstractFunction13.scala
Expand Up @@ -9,6 +9,6 @@

package scala.runtime

abstract class AbstractFunction13[-T1, -T2, -T3, -T4, -T5, -T6, -T7, -T8, -T9, -T10, -T11, -T12, -T13, +R] extends Function13[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, R] {
abstract class AbstractFunction13[-T1, -T2, -T3, -T4, -T5, -T6, -T7, -T8, -T9, -T10, -T11, -T12, -T13, +R] extends Function13[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, R] with Serializable {

}
2 changes: 1 addition & 1 deletion src/library/scala/runtime/AbstractFunction14.scala
Expand Up @@ -9,6 +9,6 @@

package scala.runtime

abstract class AbstractFunction14[-T1, -T2, -T3, -T4, -T5, -T6, -T7, -T8, -T9, -T10, -T11, -T12, -T13, -T14, +R] extends Function14[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, R] {
abstract class AbstractFunction14[-T1, -T2, -T3, -T4, -T5, -T6, -T7, -T8, -T9, -T10, -T11, -T12, -T13, -T14, +R] extends Function14[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, R] with Serializable {

}
2 changes: 1 addition & 1 deletion src/library/scala/runtime/AbstractFunction15.scala
Expand Up @@ -9,6 +9,6 @@

package scala.runtime

abstract class AbstractFunction15[-T1, -T2, -T3, -T4, -T5, -T6, -T7, -T8, -T9, -T10, -T11, -T12, -T13, -T14, -T15, +R] extends Function15[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, R] {
abstract class AbstractFunction15[-T1, -T2, -T3, -T4, -T5, -T6, -T7, -T8, -T9, -T10, -T11, -T12, -T13, -T14, -T15, +R] extends Function15[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, R] with Serializable {

}
2 changes: 1 addition & 1 deletion src/library/scala/runtime/AbstractFunction16.scala
Expand Up @@ -9,6 +9,6 @@

package scala.runtime

abstract class AbstractFunction16[-T1, -T2, -T3, -T4, -T5, -T6, -T7, -T8, -T9, -T10, -T11, -T12, -T13, -T14, -T15, -T16, +R] extends Function16[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, R] {
abstract class AbstractFunction16[-T1, -T2, -T3, -T4, -T5, -T6, -T7, -T8, -T9, -T10, -T11, -T12, -T13, -T14, -T15, -T16, +R] extends Function16[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, R] with Serializable {

}
2 changes: 1 addition & 1 deletion src/library/scala/runtime/AbstractFunction17.scala
Expand Up @@ -9,6 +9,6 @@

package scala.runtime

abstract class AbstractFunction17[-T1, -T2, -T3, -T4, -T5, -T6, -T7, -T8, -T9, -T10, -T11, -T12, -T13, -T14, -T15, -T16, -T17, +R] extends Function17[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, R] {
abstract class AbstractFunction17[-T1, -T2, -T3, -T4, -T5, -T6, -T7, -T8, -T9, -T10, -T11, -T12, -T13, -T14, -T15, -T16, -T17, +R] extends Function17[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, R] with Serializable {

}
2 changes: 1 addition & 1 deletion src/library/scala/runtime/AbstractFunction18.scala
Expand Up @@ -9,6 +9,6 @@

package scala.runtime

abstract class AbstractFunction18[-T1, -T2, -T3, -T4, -T5, -T6, -T7, -T8, -T9, -T10, -T11, -T12, -T13, -T14, -T15, -T16, -T17, -T18, +R] extends Function18[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, R] {
abstract class AbstractFunction18[-T1, -T2, -T3, -T4, -T5, -T6, -T7, -T8, -T9, -T10, -T11, -T12, -T13, -T14, -T15, -T16, -T17, -T18, +R] extends Function18[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, R] with Serializable {

}
2 changes: 1 addition & 1 deletion src/library/scala/runtime/AbstractFunction19.scala
Expand Up @@ -9,6 +9,6 @@

package scala.runtime

abstract class AbstractFunction19[-T1, -T2, -T3, -T4, -T5, -T6, -T7, -T8, -T9, -T10, -T11, -T12, -T13, -T14, -T15, -T16, -T17, -T18, -T19, +R] extends Function19[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, R] {
abstract class AbstractFunction19[-T1, -T2, -T3, -T4, -T5, -T6, -T7, -T8, -T9, -T10, -T11, -T12, -T13, -T14, -T15, -T16, -T17, -T18, -T19, +R] extends Function19[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, R] with Serializable {

}
2 changes: 1 addition & 1 deletion src/library/scala/runtime/AbstractFunction2.scala
Expand Up @@ -9,6 +9,6 @@

package scala.runtime

abstract class AbstractFunction2[@specialized(scala.Int, scala.Long, scala.Double) -T1, @specialized(scala.Int, scala.Long, scala.Double) -T2, @specialized(scala.Unit, scala.Boolean, scala.Int, scala.Float, scala.Long, scala.Double) +R] extends Function2[T1, T2, R] {
abstract class AbstractFunction2[@specialized(scala.Int, scala.Long, scala.Double) -T1, @specialized(scala.Int, scala.Long, scala.Double) -T2, @specialized(scala.Unit, scala.Boolean, scala.Int, scala.Float, scala.Long, scala.Double) +R] extends Function2[T1, T2, R] with Serializable {

}
2 changes: 1 addition & 1 deletion src/library/scala/runtime/AbstractFunction20.scala
Expand Up @@ -9,6 +9,6 @@

package scala.runtime

abstract class AbstractFunction20[-T1, -T2, -T3, -T4, -T5, -T6, -T7, -T8, -T9, -T10, -T11, -T12, -T13, -T14, -T15, -T16, -T17, -T18, -T19, -T20, +R] extends Function20[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, R] {
abstract class AbstractFunction20[-T1, -T2, -T3, -T4, -T5, -T6, -T7, -T8, -T9, -T10, -T11, -T12, -T13, -T14, -T15, -T16, -T17, -T18, -T19, -T20, +R] extends Function20[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, R] with Serializable {

}
2 changes: 1 addition & 1 deletion src/library/scala/runtime/AbstractFunction21.scala
Expand Up @@ -9,6 +9,6 @@

package scala.runtime

abstract class AbstractFunction21[-T1, -T2, -T3, -T4, -T5, -T6, -T7, -T8, -T9, -T10, -T11, -T12, -T13, -T14, -T15, -T16, -T17, -T18, -T19, -T20, -T21, +R] extends Function21[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, R] {
abstract class AbstractFunction21[-T1, -T2, -T3, -T4, -T5, -T6, -T7, -T8, -T9, -T10, -T11, -T12, -T13, -T14, -T15, -T16, -T17, -T18, -T19, -T20, -T21, +R] extends Function21[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, R] with Serializable {

}
2 changes: 1 addition & 1 deletion src/library/scala/runtime/AbstractFunction22.scala
Expand Up @@ -9,6 +9,6 @@

package scala.runtime

abstract class AbstractFunction22[-T1, -T2, -T3, -T4, -T5, -T6, -T7, -T8, -T9, -T10, -T11, -T12, -T13, -T14, -T15, -T16, -T17, -T18, -T19, -T20, -T21, -T22, +R] extends Function22[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, R] {
abstract class AbstractFunction22[-T1, -T2, -T3, -T4, -T5, -T6, -T7, -T8, -T9, -T10, -T11, -T12, -T13, -T14, -T15, -T16, -T17, -T18, -T19, -T20, -T21, -T22, +R] extends Function22[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, R] with Serializable {

}
2 changes: 1 addition & 1 deletion src/library/scala/runtime/AbstractFunction3.scala
Expand Up @@ -9,6 +9,6 @@

package scala.runtime

abstract class AbstractFunction3[-T1, -T2, -T3, +R] extends Function3[T1, T2, T3, R] {
abstract class AbstractFunction3[-T1, -T2, -T3, +R] extends Function3[T1, T2, T3, R] with Serializable {

}
2 changes: 1 addition & 1 deletion src/library/scala/runtime/AbstractFunction4.scala
Expand Up @@ -9,6 +9,6 @@

package scala.runtime

abstract class AbstractFunction4[-T1, -T2, -T3, -T4, +R] extends Function4[T1, T2, T3, T4, R] {
abstract class AbstractFunction4[-T1, -T2, -T3, -T4, +R] extends Function4[T1, T2, T3, T4, R] with Serializable {

}
2 changes: 1 addition & 1 deletion src/library/scala/runtime/AbstractFunction5.scala
Expand Up @@ -9,6 +9,6 @@

package scala.runtime

abstract class AbstractFunction5[-T1, -T2, -T3, -T4, -T5, +R] extends Function5[T1, T2, T3, T4, T5, R] {
abstract class AbstractFunction5[-T1, -T2, -T3, -T4, -T5, +R] extends Function5[T1, T2, T3, T4, T5, R] with Serializable {

}
2 changes: 1 addition & 1 deletion src/library/scala/runtime/AbstractFunction6.scala
Expand Up @@ -9,6 +9,6 @@

package scala.runtime

abstract class AbstractFunction6[-T1, -T2, -T3, -T4, -T5, -T6, +R] extends Function6[T1, T2, T3, T4, T5, T6, R] {
abstract class AbstractFunction6[-T1, -T2, -T3, -T4, -T5, -T6, +R] extends Function6[T1, T2, T3, T4, T5, T6, R] with Serializable {

}
2 changes: 1 addition & 1 deletion src/library/scala/runtime/AbstractFunction7.scala
Expand Up @@ -9,6 +9,6 @@

package scala.runtime

abstract class AbstractFunction7[-T1, -T2, -T3, -T4, -T5, -T6, -T7, +R] extends Function7[T1, T2, T3, T4, T5, T6, T7, R] {
abstract class AbstractFunction7[-T1, -T2, -T3, -T4, -T5, -T6, -T7, +R] extends Function7[T1, T2, T3, T4, T5, T6, T7, R] with Serializable {

}
2 changes: 1 addition & 1 deletion src/library/scala/runtime/AbstractFunction8.scala
Expand Up @@ -9,6 +9,6 @@

package scala.runtime

abstract class AbstractFunction8[-T1, -T2, -T3, -T4, -T5, -T6, -T7, -T8, +R] extends Function8[T1, T2, T3, T4, T5, T6, T7, T8, R] {
abstract class AbstractFunction8[-T1, -T2, -T3, -T4, -T5, -T6, -T7, -T8, +R] extends Function8[T1, T2, T3, T4, T5, T6, T7, T8, R] with Serializable {

}
2 changes: 1 addition & 1 deletion src/library/scala/runtime/AbstractFunction9.scala
Expand Up @@ -9,6 +9,6 @@

package scala.runtime

abstract class AbstractFunction9[-T1, -T2, -T3, -T4, -T5, -T6, -T7, -T8, -T9, +R] extends Function9[T1, T2, T3, T4, T5, T6, T7, T8, T9, R] {
abstract class AbstractFunction9[-T1, -T2, -T3, -T4, -T5, -T6, -T7, -T8, -T9, +R] extends Function9[T1, T2, T3, T4, T5, T6, T7, T8, T9, R] with Serializable {

}
4 changes: 2 additions & 2 deletions src/library/scala/runtime/AbstractPartialFunction.scala
Expand Up @@ -24,10 +24,10 @@ abstract class AbstractPartialFunction[-T1, +R] extends AbstractFunction1[T1, R]
* This class is used as base class for partial function literals with
* non-exhaustive pattern matchers.
*/
abstract class PFLiteral[-T1, +R] extends AbstractPartialFunction2[T1, R] with PartialFunction.Optimized[T1, R]
abstract class PFLiteral[-T1, +R] extends AbstractPartialFunction2[T1, R] with PartialFunction.Optimized[T1, R] with Serializable

/**
* This class is used as base class for partial function literals with
* certainly exhaustive pattern matchers.
*/
abstract class XPFLiteral[-T1, +R] extends AbstractPartialFunction2[T1, R] with PartialFunction.Total[T1, R]
abstract class XPFLiteral[-T1, +R] extends AbstractPartialFunction2[T1, R] with PartialFunction.Total[T1, R] with Serializable

0 comments on commit 8238c94

Please sign in to comment.