Fixed
Status Update
Comments
il...@google.com <il...@google.com>
pa...@nearside.com <pa...@nearside.com> #2
Project: platform/frameworks/support
Branch: androidx-main
commit f0dc0968ae703e34aba39b2c6c836077c340d2a5
Author: Jeremy Woods <jbwoods@google.com>
Date: Wed Sep 01 15:34:41 2021
Make argument default params last
When generating an argument in kotlin from safe args, default parameters
should always come after none defaults in the argument's constructor.
RelNote: "When generating arguments, safe args now puts parameters
without default values before those with default values."
Test: ./gradlew --rerun-tasks
navigation:navigation-safe-args-generator:test
Bug: 198493585
Change-Id: I8970968c48deb3a1437437df9a3db696ed497372
M navigation/navigation-safe-args-generator/src/main/kotlin/androidx/navigation/safe/args/generator/kotlin/KotlinNavWriter.kt
M navigation/navigation-safe-args-generator/src/test/test-data/expected/kotlin_nav_writer_test/MainFragmentArgs.kt
https://android-review.googlesource.com/1816980
Branch: androidx-main
commit f0dc0968ae703e34aba39b2c6c836077c340d2a5
Author: Jeremy Woods <jbwoods@google.com>
Date: Wed Sep 01 15:34:41 2021
Make argument default params last
When generating an argument in kotlin from safe args, default parameters
should always come after none defaults in the argument's constructor.
RelNote: "When generating arguments, safe args now puts parameters
without default values before those with default values."
Test: ./gradlew --rerun-tasks
navigation:navigation-safe-args-generator:test
Bug: 198493585
Change-Id: I8970968c48deb3a1437437df9a3db696ed497372
M navigation/navigation-safe-args-generator/src/main/kotlin/androidx/navigation/safe/args/generator/kotlin/KotlinNavWriter.kt
M navigation/navigation-safe-args-generator/src/test/test-data/expected/kotlin_nav_writer_test/MainFragmentArgs.kt
ap...@google.com <ap...@google.com> #3
This has been fixed internally and will be available in the Navigation 2.4.0-alpha09
release.
jb...@google.com <jb...@google.com> #4
Problem as a result of this in alpha09, it will now generate broken code when nullable parameters are before non-nullable parameters in the navigation resource file.
Description
Component used: Navigation Version used: 2.5.0-alpha03
If you set up an Android library module with NO MANIFEST and the following
android
block:SafeArgs throws the following error:
This is surprising, because of the following line in the docs:
(source:https://developer.android.com/studio/publish-library/prep-lib-release )
I've created a small sample project showing this error, attached to the ticket.