android-saripaar icon indicating copy to clipboard operation
android-saripaar copied to clipboard

Can't annotate delegated properties in newer Kotlin

Open kikuchy opened this issue 9 years ago • 10 comments

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.

kikuchy avatar Dec 26 '15 10:12 kikuchy

Thanks for reporting this. Will look into it. Feel free to send in a pull request (along with test cases) if you can.

ragunathjawahar avatar Jan 07 '16 05:01 ragunathjawahar

+1

carmas123 avatar Apr 23 '16 19:04 carmas123

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 avatar Sep 26 '16 05:09 sergeymild

@sergeymild sample code please.

rjoncontract avatar Sep 28 '16 01:09 rjoncontract

+1

edsilfer avatar Dec 30 '16 13:12 edsilfer

any progress?

luna-vulpo avatar Feb 21 '17 13:02 luna-vulpo

has any progress?

scrobot avatar May 13 '17 09:05 scrobot

@delegate:NotEmpty should do the trick.

saket avatar Dec 21 '18 12:12 saket

has any progress?

mnayef95 avatar Mar 23 '19 16:03 mnayef95

@mnayef95 PRs are welcome.

ragunathjawahar avatar Mar 24 '19 05:03 ragunathjawahar