vicpinm / Kotlin-Realm-Extensions

Kotlin extensions to simplify Realm API.
Apache License 2.0
535 stars 53 forks source link

Issue with generic type. #28

Closed afaucogney closed 6 years ago

afaucogney commented 7 years ago

I defined an base interface for my repo like this.

interface BaseDataStore<T : RealmObject> {

    fun getObject(): T
    fun getPrimaryKeyAttribute(): String
    fun getPrimaryKey(item: T): String

    fun add(item: T): Completable {
        return Completable
                .fromAction { item.save() }
}

It was compiling with 1.x version, but I just updated with latest version of realm extension + realm 3.5 => real 4.1 an this is not compiling anymore:

I get: cannot use t as reified type parameter use class instead

vicpinm commented 6 years ago

Hi @afaucogney, I will try to look at this as soon as possible.

vicpinm commented 6 years ago

@afaucogney You can now try the beta2. It should work now. Thanks for the report.