I have the following toplevel class:
class Example(shared String first = "default one", shared String second = "default two") {
}
Now, I want to instantiate this class using an explicit value for first
, but the default value for second
.
I know how to do this via explicitly compiled code, by using named arguments:
void instantiateExample(String firstValue) {
Example ex = Example { first = firstValue; };
assert(ex.first == firstValue);
assert(ex.second == "default two");
}
Now, I would like to do the same thing as the above code, but by using the Class<Example, []|[String,String=]>
object.