Vishnu Shrikar
01/18/2024, 9:14 AM@Composable fun <Q> doAction(input: T, actionCode: Int, actionData: Q? = null)
Error:
Abstract Composable functions cannot have parameters with default values
So, I cant use default parameters in interfaces and because of how interfaces work I cannot override them in the implementation so im just SOL eh.
So I am doing my BEST to not scream at the chat (because oh my god im mad) here but I have 2 questions
1. Why shouldn't I be angry as hell about this. This should not have been made this way.
2. What workaround options do I have for this.
In the most mild terms, this is a MASSIVE dissapointment and really should be fixed.hfhbd
01/18/2024, 11:15 AMVishnu Shrikar
01/18/2024, 12:11 PMhfhbd
01/18/2024, 12:23 PMRuckus
01/18/2024, 4:42 PMinterface Thing<T> {
@Composable
fun <Q> doAction(input: T, actionCode: Int, actionData: Q?)
}
@Composable
fun <T> Thing<T>.doAction(input: T, actionCode: Int) =
doAction<Nothing>(input, actionCode, null)
Edit: Sorry @hfhbd, I just realized that's what you already suggested. I should have read better.Ruckus
01/18/2024, 4:46 PMQ
type is here. Since it's defined on an interface function and only relates to a single argument, what does it gain over
fun doAction(input: T, actionCode: Int, actionData: Any?)
Vishnu Shrikar
01/18/2024, 8:28 PM