mirror of
https://github.com/digital-asset/daml.git
synced 2024-09-20 01:07:18 +03:00
remove small Scala 2.12 artifacts (#13618)
* remove unneeded type-param indirection with proper Scala support * remove readFile; it is unused CHANGELOG_BEGIN CHANGELOG_END
This commit is contained in:
parent
6a570ea2ac
commit
1d1fbb10af
@ -366,14 +366,13 @@ sealed abstract class Queries(tablePrefix: String, tpIdCacheMaxEntries: Long)(im
|
||||
},
|
||||
fr" OR ",
|
||||
)
|
||||
// we effectively shadow Mark because Scala 2.12 doesn't quite get
|
||||
// that it should use the GADT type equality otherwise
|
||||
def goQuery[Mark0: Read](
|
||||
@nowarn("cat=unused&msg=MarkR in method goQuery.*is never used") // false negative
|
||||
def goQuery(
|
||||
tpid: Fragment
|
||||
): Query0[DBContract[Mark0, JsValue, JsValue, Vector[String]]] = {
|
||||
)(implicit MarkR: Read[Mark]): Query0[DBContract[Mark, JsValue, JsValue, Vector[String]]] = {
|
||||
val q = query(tpid, queriesCondition)
|
||||
q.query[
|
||||
(String, Mark0, Key, Option[String], JsValue, SigsObs, SigsObs, Agreement)
|
||||
(String, Mark, Key, Option[String], JsValue, SigsObs, SigsObs, Agreement)
|
||||
].map { case (cid, tpid, rawKey, keyHash, payload, signatories, observers, rawAgreement) =>
|
||||
DBContract(
|
||||
contractId = cid,
|
||||
@ -391,9 +390,9 @@ sealed abstract class Queries(tablePrefix: String, tpIdCacheMaxEntries: Long)(im
|
||||
trackMatchIndices match {
|
||||
case MatchedQueryMarker.ByInt =>
|
||||
val tpid = projectedIndex(queries.zipWithIndex, tpidSelector = tpidSelector)
|
||||
goQuery[MatchedQueries](tpid)
|
||||
goQuery(tpid)
|
||||
case MatchedQueryMarker.Unused =>
|
||||
goQuery[SurrogateTpId](tpidSelector)
|
||||
goQuery(tpidSelector)
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -11,7 +11,6 @@ import akka.util.ByteString
|
||||
import com.typesafe.scalalogging.LazyLogging
|
||||
|
||||
import scala.concurrent.{ExecutionContext, Future}
|
||||
import scala.io.Source
|
||||
import scala.util.{Failure, Success, Try, Using}
|
||||
|
||||
object TestUtil extends LazyLogging {
|
||||
@ -29,20 +28,6 @@ object TestUtil extends LazyLogging {
|
||||
file
|
||||
}
|
||||
|
||||
def readFile(resourcePath: String): String =
|
||||
Try {
|
||||
val source = Source.fromResource(resourcePath)
|
||||
val content = source.getLines().mkString
|
||||
source.close
|
||||
content
|
||||
} match {
|
||||
case Success(value) => value
|
||||
// only needed for Scala 2.12; 2.13 does this itself
|
||||
case Failure(_: NullPointerException) =>
|
||||
throw new java.io.FileNotFoundException(s"resource '$resourcePath' not found in classpath")
|
||||
case Failure(ex) => throw ex
|
||||
}
|
||||
|
||||
def getResponseDataBytes(resp: HttpResponse, debug: Boolean = false)(implicit
|
||||
mat: Materializer,
|
||||
ec: ExecutionContext,
|
||||
|
Loading…
Reference in New Issue
Block a user