You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
26 lines
514 B
26 lines
514 B
3 years ago
|
// @Module:Main
|
||
|
import androidx.compose.runtime.Composable
|
||
|
import androidx.compose.runtime.currentComposer
|
||
|
import androidx.compose.runtime.Composer
|
||
|
|
||
|
fun main() {
|
||
|
callComposable {
|
||
|
ComposableWithDefaultParamsDefinedByOtherParams("a")
|
||
|
}
|
||
3 years ago
|
require(result == "aa") { "Actual result was - $result"}
|
||
3 years ago
|
}
|
||
|
|
||
|
|
||
|
// @Module:Lib
|
||
|
import androidx.compose.runtime.Composable
|
||
|
|
||
3 years ago
|
var result = ""
|
||
|
|
||
3 years ago
|
@Composable
|
||
|
fun ComposableWithDefaultParamsDefinedByOtherParams(
|
||
|
a: String,
|
||
|
b: String = a
|
||
|
) {
|
||
3 years ago
|
result = a + b
|
||
3 years ago
|
}
|