You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
and I Get errors because it converts Int -> FiniteDuration Data conversion error converting "'20 seconds' SQL statement: (TEST_TABLE: ""ID"" INTEGER NOT NULL)"
slandelle
changed the title
New implicits in core.Predef breaks logic with Expression[Any]
Core: New implicits in core.Predef breaks logic with Expression[Any]
Jan 21, 2022
…#4195
Motivation:
In 3.7, we introduced `Int => Expression[FiniteDuration]` implicit conversions.
In some cases, for example `queryParam("foo", 1)`, we want the existing `T => Expression[T]` implicit conversion to trigger, but the new implicit seems to have higher priority, probably because it's more precise.
Modification:
* drop the new implicit Expression[FiniteDuration] conversions
* add a new function to Expression implicit conversion
* make sure that value to Expression implicit conversion can't be applied on Strings (we want to EL conversion to trigger)
* the Scala compiler doesn't properly figure out implicit conversions when using overloading. I couldn't figure out the rules here?! Use more overloads to remove some of the needs of implicit conversions and convert manually instead.
Result:
`queryParam("foo", 1)`, properly generate an `Expression[Int]` and not an `Expression[FiniteDuration]`.
Hello!
When I migrated to gatling, I noticed a problem with the new implicits in
import io.gatling.core.Predef._
Use Case:
our jdbc plugin https://github.com/Tinkoff/gatling-jdbc-plugin/blob/5edf8a2c6441d0af80b2f16e52e276591e195a4b/src/test/scala/ru/tinkoff/load/jdbc/test/cases/Actions.scala#L36
My script:
InsertInto("TEST_TABLE", Columns("ID", "NAME")).values("ID" -> 20, "NAME" -> "Test 12"),
def values(values: (String, Expression[Any])*)
An unexpected implicit conversion occurs
and I Get errors because it converts Int -> FiniteDuration
Data conversion error converting "'20 seconds' SQL statement: (TEST_TABLE: ""ID"" INTEGER NOT NULL)"
Also I noticed a problem with gatling-core dsl
and other cases with http queryParam, http formParam, jms etc.
https://github.com/gatling/gatling/search?q=Expression%5BAny%5D
Could you revert that implicits? We need
implicit def value2Expression
The text was updated successfully, but these errors were encountered: