You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
just got my hand on the new release 1.6.0 and noticed to get errors when the field name is equal to the string specified in the annotation @PersistedName.
- Property '<Class>.<field>' has an alias '<alias>' that conflicts with a property of the same name.
I think that wasn't the case on Realm-Java? I like to add this annotation to every field (and class once #1138 is done) to make sure not to break things during refactoring in future. Furthermore I declare constants that are used in the annotation and for queries to have a single point of truth (hardcoded strings) avoiding having magic strings all around the code base (Kotlin does not have a fancy nameof() like C# that would solve this issue).
Would be great if the annotation could just be ignored when the value equals the field name until the field name is changed for whatever reason in future.
Many thanks and keep up the great work!
The text was updated successfully, but these errors were encountered:
However, I think this is not fixed yet. If you add a second property with same PersistentName and FieldName to your test you should run into the following error:
[Realm] Kotlin names and persisted names must be unique. '' has already been used for the field on line <line-nr of the first annotation with same names>.
For me it looks like an empty string is not valid (see NO_ALIAS) as it seems to be used as a key anyway.
Ahh, yeah. Didn't knew we had a check for overlapping values that also needed an update. It isn't kicking in in our test as there is only one field that gets cleared with the "" value.
Hi there,
just got my hand on the new release 1.6.0 and noticed to get errors when the field name is equal to the string specified in the annotation
@PersistedName
.I think that wasn't the case on Realm-Java? I like to add this annotation to every field (and class once #1138 is done) to make sure not to break things during refactoring in future. Furthermore I declare constants that are used in the annotation and for queries to have a single point of truth (hardcoded strings) avoiding having magic strings all around the code base (Kotlin does not have a fancy
nameof()
like C# that would solve this issue).Would be great if the annotation could just be ignored when the value equals the field name until the field name is changed for whatever reason in future.
Many thanks and keep up the great work!
The text was updated successfully, but these errors were encountered: