Closed ppamorim closed 1 year ago
Hey @ppamorim, is it possible to create a typealias in your project so you can omit the imports?
Something like
import RealmSwift
typealias RealmObject = Realm.Object
in its own file, then it shouldn't be necessary to import RealmSwift and Cuckoo will not add it to the generated file.
It could of course be worked around by adding a CLI option, but I'd like to keep that to a minimum before we switch to TOML configuration.
@MatyasKriz I will test that, thanks.
Edit: This works, luckly I had the database isolated in my application and it was easy to fix.
Should I reopen the issue to keep track of the feature request?
Cuckoo is generating for the given protocol:
This mock:
This is causing Swift not be able to know from where
User
is coming. Returning the error'User' is ambiguous for type lookup in this context
. This is happening becauseRealmSwift.User
is a thing (typealias User = RLMUser
).To temporarily measure to sort this I am manually removing
import RealmSwift
as this is not required for the mock, but it's not healthy to haveCuckoo
generator disabled.Offtopic, when the latest version on master with the fix for the
_
parameters will be released? I had to manually compile the source code and getcuckoo_generator
from the master branch source code to make it work.