android-saripaar
android-saripaar copied to clipboard
Can't annotate delegated properties in newer Kotlin
We (I and my project members) glad to use android-sarippar, we are helped by it.
In the project using Kotlin 1.0.0-beta-4584, android-sarippar's annotations are not used.
I annotated like this,
class MainActivity : AppCompatActivity(), Validator.ValidationListener {
@NotEmpty
var editText: EditText by Delegates.notNull()
...
and compile error caused.
Error:(18, 5) This annotation is not applicable to target 'member property without backing field'
In Kotlin, proteries without backing field can't annotate with the annotation has @Target(ElementType.FIELD) .
(The annotation that is made with Kotlin and has @Target(AnnotationTarget.FIELD, AnnotationTarget.PROPERTY) can use like now in Java and Kotlin. And I think android-sarippar needs some fixes for Validator class for support Kotlin.)
We hope android-sarippar support delegated properties in latest Kotlin.
Thanks for reporting this. Will look into it. Feel free to send in a pull request (along with test cases) if you can.
+1
I have same problem, but with Jackson. Have model with @JsonIgnoreProperties(ignoreUnknown = true) annotation, and then i compile project i have error Error:(11, 1) This annotation is not applicable to target 'class'
@sergeymild sample code please.
+1
any progress?
has any progress?
@delegate:NotEmpty should do the trick.
has any progress?
@mnayef95 PRs are welcome.