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
The sad thing is "bool" is duplicated. For instance, when If("bool") is created in another method, it won't even fail if the parameter with that name does not exist.
What if func scope provided property that could be used to declare, and retrieve parameters and locals?
For instance:
createFun{
func("func") {
// Below adds a parameter to the function. It knows data type, it knows the nameval flag by parameters.creating<Boolean>()
If(flag) {
...
createFun{
func("func") {
// Below adds a parameter to the function. It knows data type, it knows the nameval flag by parameters.creating<Boolean> {
// configure initializers, varargs or whatever (it will go to the function parameter declaration)
}
If(flag) {
...
createFun{
func("func", "flag" of Boolean::class) {
val flag by parameters.existing // throw if parameter named "flag" does not existIf(flag) {
...
The text was updated successfully, but these errors were encountered:
For instance:
KotlinPoetDSL/src/test/kotlin/nl/devhaan/kotlinpoetdsl/codeblock/IfTest.kt
Lines 21 to 25 in f1a579b
The sad thing is
"bool"
is duplicated. For instance, whenIf("bool")
is created in another method, it won't even fail if the parameter with that name does not exist.What if
func
scope provided property that could be used to declare, and retrieve parameters and locals?For instance:
The text was updated successfully, but these errors were encountered: