Hey! I would like to know if there’s a non-“workaround” solution to a type checking issue I’m facing:
Imagine the following example function:
What I would like to do is to provide a default
The above doesn’t compile because
is of type
makes it so that I can’t call
because there isn’t enough type information to infer that
(i.e. I would have to call
), which is a no-go.
The obvious “workaround” solution here is to create a second function that calls the first function with the my default
However, is there any way to make this work without relying on a second function? I.e., by providing a default argument to the first version of the function? I played around with the
experimental directive but couldn’t get it to work. Am I missing something?