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
data classMyNavArgs(
/** This is an awesome property. */valmyProperty:Boolean = false
)
@WmsDestination(navArgsDelegate =MyNavArgs::class)
@Composable
funMyScreen(navigator:DestinationsNavigator, navArgs:MyNavArgs) {}
This code results in IllegalDestinationsSetup: Navigation arguments using function calls with parameters as their default value... -
throwIllegalDestinationsSetup("Navigation arguments using function calls with parameters as their default value "+
data classMyNavArgs(
/** This is an awesome (usually) property. */valmyProperty:Boolean = false
)
@WmsDestination(navArgsDelegate =MyNavArgs::class)
@Composable
funMyScreen(navigator:DestinationsNavigator, navArgs:MyNavArgs) {}
Took me a quite to figure out because the error message did not seem related to the default property at all.
Thanks for the awesome library! I removed the parentheses for now but wanted to provide an FYI for any that run across this issue.
The text was updated successfully, but these errors were encountered:
Yes in this manual parsing of the default value there are limitless possibilities and there will always be some case it doesn’t support well.
Of course I will fix it everytime something unexpected is found, such as this one. I’m also adding new cases to unit tests so that there’s no regression as I fix more and more of these.
@ryanholden8 Can you tell me which version are you using? I cannot reproduce it with the exact nav args class you used in the example. I was able to reproduce it if I put the comment in the line after the parameter though.
I just want to make sure that it is the same issue you have.
This code works:
This code results in
IllegalDestinationsSetup: Navigation arguments using function calls with parameters as their default value...
-compose-destinations/compose-destinations-ksp/src/main/kotlin/com/ramcosta/composedestinations/ksp/commons/DefaultParameterValueReader.kt
Line 114 in 6ea4ab7
Took me a quite to figure out because the error message did not seem related to the default property at all.
Thanks for the awesome library! I removed the parentheses for now but wanted to provide an FYI for any that run across this issue.
The text was updated successfully, but these errors were encountered: