Skip to content

Commit 2b556a6

Browse files
author
Roman Janusz
authored
Merge pull request #437 from AVSystem/2.11-compat
Remove Scala 2.11 compat code
2 parents 3d7923d + d1712ce commit 2b556a6

File tree

2 files changed

+3
-6
lines changed

2 files changed

+3
-6
lines changed

core/src/test/scala/com/avsystem/commons/serialization/CodecTestData.scala

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -80,16 +80,14 @@ object CodecTestData {
8080
@mongoId def id: String
8181
@generated @name("upper_id") def upperId: String = id.toUpperCase
8282
}
83-
object FlatSealedBase {
83+
object FlatSealedBase extends HasGenCodec[FlatSealedBase] {
8484
case class FirstCase(id: String, int: Int = 42) extends FlatSealedBase
8585
case class SecondCase(id: String, dbl: Double, moar: Double*) extends FlatSealedBase
8686
case object ThirdCase extends FlatSealedBase {
8787
@generated def id = "third"
8888
}
8989
case class RecursiveCase(id: String, sub: Opt[FlatSealedBase]) extends FlatSealedBase
9090
case class LocallyRecursiveCase(id: String, sub: Opt[LocallyRecursiveCase]) extends FlatSealedBase
91-
// for Scala 2.11
92-
implicit val codec: GenCodec[FlatSealedBase] = GenCodec.materialize
9391
}
9492

9593
@flatten sealed trait TransparentFlatSealedBase

mongo/jvm/src/main/scala/com/avsystem/commons/mongo/typed/MongoRef.scala

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import com.avsystem.commons.mongo.{BsonValueInput, KeyEscaper}
99
import com.avsystem.commons.serialization.GenCodec.ReadFailure
1010
import com.avsystem.commons.serialization.TransparentWrapping
1111
import org.bson.{BsonDocument, BsonValue}
12+
import scala.annotation.tailrec
1213

1314
/**
1415
* Represents a reference to a particular "place" in a MongoDB document. The "place" may be an actual path
@@ -188,9 +189,7 @@ sealed trait MongoPropertyRef[E, T] extends MongoRef[E, T]
188189
def twoDimIndex: MongoIndex[E] = index(MongoIndexType.TwoDim)
189190
def twoDimSphereIndex: MongoIndex[E] = index(MongoIndexType.TwoDimSphere)
190191

191-
//noinspection NoTailRecursionAnnotation
192-
//no @tailrec because Scala 2.11 has problems with it
193-
private def computePath[T0](
192+
@tailrec private def computePath[T0](
194193
onlyUpToArray: Boolean,
195194
ref: MongoPropertyRef[E, T0],
196195
acc: List[String],

0 commit comments

Comments
 (0)