I have a function defined as follows:
getTypeB(id: String,
valA1: TypeA = defaultA1
valA2: TypeA = defaultA2,
valA3: TypeA = defaultA3 ) : TypeB {}
I know using named arguments I can call the above function with only some of the vals, like
getTypeB(id,
valA2 = someValueOfTypeA )
My question is, is here any way for the literal text valA2
to be a variable. I wanted to be able call getTypeB
from somewhere else, where they won't know the argument argument names unless they're passed in. So is there a way to use a variable for a named argument? If not, us there any other alternative I can use here?