Skip to content
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

@PropDefault problem on kotlin 1.4.10 #720

Open
1 task
TimurKhairnasov opened this issue Oct 29, 2020 · 6 comments
Open
1 task

@PropDefault problem on kotlin 1.4.10 #720

TimurKhairnasov opened this issue Oct 29, 2020 · 6 comments

Comments

@TimurKhairnasov
Copy link

TimurKhairnasov commented Oct 29, 2020

Version

0.38.0

Issues and Steps to Reproduce

After upgrate kotlin to 1.4.10 can't build project because of the problem below:
image

it goes from @PropDefault value. Removing it solves the problem, but I'd like to use it)

@colriot take a look, please)

@colriot
Copy link
Contributor

colriot commented Oct 29, 2020

Hi @TimurKhairnasov ! Yep, seems that it's happening due to the new synthetics methods generation behaviour: https://kotlinlang.org/docs/reference/compatibility-guide-14.html#kapt-names-of-synthetic-annotations-methods-for-properties-have-changed

To mitigate this you can mark @PropfDefault fields as @JvmField, it will fix the compilation

@TimurKhairnasov
Copy link
Author

@colriot, compilation has fixed, but default values are not setting up. Int value is 0, despite of PropDefault value.

  • for VerticalGravity value error: Parameter specified as non-null is null
    image

@tpucci
Copy link

tpucci commented Nov 11, 2020

I have the same issue 😕 , @TimurKhairnasov have you found a workaround?

@tpucci
Copy link

tpucci commented Nov 11, 2020

Ok, I have found a workaround, after seeing this:

* If a user annotates that variable with `@get:PropDefault` we identify the

Change all @PropDefaut with @get:PropDefault and it should work.

I checked generated Component and they look the same before (kotlin 1.3.72 and @PropDefaut) and after (kotlin 1.4.10 and @get:PropDefaut).

(thanks @tychota for pointing me in the right direction) 🥳

@pavlospt
Copy link
Contributor

Well hello there 😄 I remember the days I was fixing this 😂 @colriot should I give it a try and port it to the new behavior?

@TimurKhairnasov
Copy link
Author

@tpucci helped me too, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants