first of all: the current behavior is totally documented, you can treat this as a "feature request"/improvement.
Let's say I have this function in my component
sub myFunction(myFlag = true as boolean)
...
end sub
and I try to invoke it from the external with the @ syntax. I don't pass any value so I assume that myFlag is set to true
myComponent@.myFunction()
but bsc compiles the snippet to
myComponent.callfunc("myFunction", invalid)
witch translates to the runtime error: Type Mismatch. Unable to cast "roInvalid" to "Boolean".
Ideally, instead, the translation of @ should check if the first value of the function has a default value, and use it. In this case compiling to
myComponent.callfunc("myFunction", true)