FlexTradeUKLtd/kfixture

Collection fixtures generate empty collections

Opened this issue · 1 comments

rses commented

kFixture uses reified types, which are resolved during runtime, and due to type erasure, it can only generate an empty collection and not create the fixture items themselves.

There are some gymnastics that can be done using super type tokens but we result in wildcard types which jFixture seems to get upset about. Potentially could get around this by doing further gymnastics on bounding the wildcard types, but this just starts getting messy.

Kotlin 1.3.40 has support for a new feature called typeOf but it's still EAP.

Work around for now would be to use factory methods for collections, such as:

List(5) { kFixture<FooBar>() }

1.3.40 is released