From 76eb3d412fa33f94e51c77a4dc12a7720e51038b Mon Sep 17 00:00:00 2001 From: Serhii Pererva Date: Fri, 24 Nov 2023 10:22:45 +0000 Subject: [PATCH] Update CqlPrimitiveEncoder.scala Use the right constraint in `encodePrimitiveByIndex`. In case of `TupleValue` it implements `SettableByIndex`. This changes the constraint in `encodePrimitiveByIndex` to use `SettableByIndex` instead of `SettableByName` --- .../kaizensolutions/virgil/codecs/CqlPrimitiveEncoder.scala | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/src/main/scala/io/kaizensolutions/virgil/codecs/CqlPrimitiveEncoder.scala b/core/src/main/scala/io/kaizensolutions/virgil/codecs/CqlPrimitiveEncoder.scala index 7e56b7e..3551f55 100644 --- a/core/src/main/scala/io/kaizensolutions/virgil/codecs/CqlPrimitiveEncoder.scala +++ b/core/src/main/scala/io/kaizensolutions/virgil/codecs/CqlPrimitiveEncoder.scala @@ -2,7 +2,7 @@ package io.kaizensolutions.virgil.codecs import com.datastax.oss.driver.api.core.`type`._ import com.datastax.oss.driver.api.core.data.CqlDuration -import com.datastax.oss.driver.api.core.data.SettableByName +import com.datastax.oss.driver.api.core.data.{SettableByName, SettableByIndex} import com.datastax.oss.driver.api.core.data.UdtValue import scala.jdk.CollectionConverters._ @@ -88,7 +88,7 @@ object CqlPrimitiveEncoder { structure.set(fieldName, driverValue, other.driverClass) } - def encodePrimitiveByIndex[Structure <: SettableByName[Structure], Scala]( + def encodePrimitiveByIndex[Structure <: SettableByIndex[Structure], Scala]( structure: Structure, index: Int, value: Scala