Skip to content
This repository was archived by the owner on Feb 20, 2019. It is now read-only.

Commit ecbe614

Browse files
committed
Merge branch 'support-for-transient' of github.com:scala/pickling into support-for-transient
2 parents c703d5d + 8763c7b commit ecbe614

File tree

1 file changed

+4
-8
lines changed

1 file changed

+4
-8
lines changed

core/src/main/scala/pickling/ir/IRs.scala

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ class IRs[U <: Universe with Singleton](val uni: U) {
2424
// this part is interesting to unpicklers
2525
def hasSetter = setter.isDefined
2626
def isErasedParam = isParam && accessor.isEmpty // TODO: this should somehow communicate with the constructors phase!
27-
def isReifiedParam = isParam && accessor.nonEmpty
2827
def isNonParam = !isParam
2928
}
3029
case class ClassIR(tpe: Type, parent: ClassIR, fields: List[FieldIR]) extends PickleIR
@@ -56,10 +55,8 @@ class IRs[U <: Universe with Singleton](val uni: U) {
5655
val (filteredAccessors, transientAccessors) = allAccessors.partition(notMarkedTransient)
5756

5857
val ctorParams = if (ctor != NoSymbol) ctor.asMethod.paramss.flatten.flatMap { sym =>
59-
if (transientAccessors.exists(acc => acc.name.toString == sym.name.toString)) {
60-
//println(s"found a BAD accessor: $sym")
61-
List()
62-
} else List(sym.asTerm)
58+
if (transientAccessors.exists(acc => acc.name.toString == sym.name.toString)) List()
59+
else List(sym.asTerm)
6360
} else Nil
6461

6562
val (paramAccessors, otherAccessors) = allAccessors.partition(_.isParamAccessor)
@@ -75,16 +72,15 @@ class IRs[U <: Universe with Singleton](val uni: U) {
7572
val varGetters = otherAccessors.collect{ case meth if meth.isGetter && meth.accessed != NoSymbol && meth.accessed.asTerm.isVar => meth }
7673
val varFields = varGetters.map(sym => mkFieldIR(sym, None, Some(sym)))
7774

78-
val res = paramFields ++ varFields
79-
res
75+
paramFields ++ varFields
8076
}
8177

8278
private def composition(f1: (Q, Q) => Q, f2: (C, C) => C, f3: C => List[C]) =
8379
(c: C) => f3(c).reverse.reduce[C](f2)
8480

8581
private val f1 = (q1: Q, q2: Q) => q1 ++ q2
8682

87-
private val f2 = (c1: C, c2: C) => ClassIR(c2.tpe, c1, /*fields(c2.tpe)*/c2.fields) // here: fields is called a 2nd time.
83+
private val f2 = (c1: C, c2: C) => ClassIR(c2.tpe, c1, c2.fields)
8884

8985
private val f3 = (c: C) =>
9086
c.tpe.baseClasses

0 commit comments

Comments
 (0)