Make a polymorphic VI (or whatever the 2018 equivalent is called) for all of the different types of control references.
I realized moments after posting that I should have said, ". . . that doesn't require making a polymorphic VI for every type of control refnum".
So, is there any other way?
I don't think so. How else can you change the output terminal to be a different reference type?
Malleable VI's may not work in this case. I've never used them so I can't say for sure.
Do you really need the reference as an output? Could you not branch the wire before the subVI?
You can do it by making two subVIs, a VIM and a normal subVI. For the VIM you need to set the VI properties correctly, like so
Make sure you save the extension as VIM.
Set up you VIM like so,
The subVI in the case structure is just what you had before,
You have to do it this way because the property node cannot be inlined.
I was just able to test and this works.
However, I'm going to go back to just branching before sinking the ref in the VI because I can't put the VIM in my UI utilities packed library.
It bothers me that the refnum type isn't preserved like a class type with a dynamic terminal, but I imagine changing that would not be worth the massive effort.
Are VIMs not compatible with packed libraries? Sorry, I had no idea.
Below is the basically the same VIM except the wire is not branched, it goes through the subVI, you just need to add one more step.