Sub Button1_Click
Wait For (returnMapORString) Complete (result As Object)
Log(result)
Log(GetType(result))'got Map instead of Map$MyMap
If result Is Map Then
Dim m As Map = result
Log(m.Get("test"))
End If
End Sub
Sub returnMapORString As ResumableSub
Return CreateMap("test":"test")
End Sub
It is more than that, the JVM is very efficient and even if it did create an extra wrapper object (which is basically an object with a single pointer) the performance overhead will be insignificant. Now if it is inside a loop that is called million times then it makes sense to think about such mini-optimizations, but in the general case, such optimizations don't make any difference.