-
Notifications
You must be signed in to change notification settings - Fork 65
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
RealmObject interface/class extension with generics crashes #999
Comments
Hi @Burtan. We will try to devise a fix for this problem since the code you wrote is syntactically correct and the error appears to be stemming from our compiler plugin. Though I have an observation about the class definition you wrote. I assume you want to create an inheritance hierarchy by writing, say
While the class declaration you wrote and the one above are syntactically correct, inheritance/polymorphism is not supported by Realm yet and therefore you will not be able to use this in your schema - see realm/realm-java#761 for more info. This constraint from our SDK would render your problem moot (if this is in fact what you are trying to do) as you would not be able to use said hierarchies in Realm. |
I think my case is a little special. I'm using multiple interfaces on my entity classes
To use generics on a combination of these interfaces I need a common interface that I don't inherit from.
|
Hi @Burtan. Even though you are not using Additionally:
should be allowed as long as your Something along these lines should also be allowed, again, as long as you don't make your interface inherit from
We will try to devise a bug fix for |
Thanks for the effort and extensive explanation already! |
Hi,
when using generics on an interface/class that extends RealmObject you get an error. Not sure if it is kotlin or realm though.
class BaseEntity<T> : RealmObject
The text was updated successfully, but these errors were encountered: