OneAdapter icon indicating copy to clipboard operation
OneAdapter copied to clipboard

You can't use interface as M : Diffable in intem module

Open PiotrArent96 opened this issue 2 years ago • 1 comments

Because of line 12 in com.idanatz.oneadapter.internal.utils in generic.kt you can't use ItemModule with interfaces as in

class MyModule() : ItemModule<SomeInterface>

SomeInterface being

interface SomeInterface { ... }

It causes crash. It's because you are using if (className.startWith("class ")) { } And class name for interface starts with "interface "

You can use abstract class tho since its class name starts with "class " but it simply will do nothing since you can have object with class name of abstract class, and thats how library indentifies types

Also im certain that what you are implementing here is just type.typeName

PiotrArent96 avatar Jul 26 '23 11:07 PiotrArent96

Hey

Thanks for the report, il look into it and update.

idanatz avatar Aug 03 '23 12:08 idanatz