Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -80,16 +80,14 @@ object CodecTestData {
@mongoId def id: String
@generated @name("upper_id") def upperId: String = id.toUpperCase
}
object FlatSealedBase {
object FlatSealedBase extends HasGenCodec[FlatSealedBase] {
case class FirstCase(id: String, int: Int = 42) extends FlatSealedBase
case class SecondCase(id: String, dbl: Double, moar: Double*) extends FlatSealedBase
case object ThirdCase extends FlatSealedBase {
@generated def id = "third"
}
case class RecursiveCase(id: String, sub: Opt[FlatSealedBase]) extends FlatSealedBase
case class LocallyRecursiveCase(id: String, sub: Opt[LocallyRecursiveCase]) extends FlatSealedBase
// for Scala 2.11
implicit val codec: GenCodec[FlatSealedBase] = GenCodec.materialize
}

@flatten sealed trait TransparentFlatSealedBase
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import com.avsystem.commons.mongo.{BsonValueInput, KeyEscaper}
import com.avsystem.commons.serialization.GenCodec.ReadFailure
import com.avsystem.commons.serialization.TransparentWrapping
import org.bson.{BsonDocument, BsonValue}
import scala.annotation.tailrec

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

//noinspection NoTailRecursionAnnotation
//no @tailrec because Scala 2.11 has problems with it
private def computePath[T0](
@tailrec private def computePath[T0](
onlyUpToArray: Boolean,
ref: MongoPropertyRef[E, T0],
acc: List[String],
Expand Down