Replies: 1 comment 3 replies
-
|
I'm a bit reluctant for adding a |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Soo... maybe I'm just too dumb, but I often run into a problem like this:
This obviously doesn't compile, because the default value for
features([]) is no fully specified type. The compiler knows it's an array, but not what its item is. Now, some cases of this could probably be "fixed" by #514, but another Idea I got is this:This would allow specifying optional arguments without default value. (If not specified - they are simply
not defined).The (IMHO massive) advantage of this is, that each
if is (not) definedis resolved at compile-time - and the code for the other branch is never generated. This reduces the code generated - and resolves the problem of unspecified types in the default case.(The shown example is much simpler than what I typically have - where the array items are complex objects)
Beta Was this translation helpful? Give feedback.
All reactions