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
datatable: Replace wildcard type with its upper bound
When registering steps in Kotlin using Kotlin collections as an argument e.g:
```kotlin
@given("orders with an order item and the following attributes:")
fun statusFilterOrdersInEs(attributes: Map<String, Map<String, String>>)
```
This argument is translated to Java type as
```java
Map<java.lang.String, ? extends java.util.Map<java.lang.String, java.lang.String>>
```
To handle this gracefully the simplified type system used by `DataTable`
should understand upper bounds. We do this by replacing the wild card type
with its upper bound.
We can assume this is safe because when registering a transformer to
`type ? extends SomeType` the transformer is guaranteed to produce an
object that is an instance of `SomeType`.
When transforming a data table to ``? extends SomeType` a transformer that
produces `SomeType` is sufficient.
This will result in ambiguity between a transformers for `SomeType` and
transformers for ``? extends SomeType` but that seems reasonable and might be
resolved by using a more specific producer.
0 commit comments