A
Armin Zingler
Hi group,
why can't I overload these procedures?
Private Sub proc(ByVal arg As String())
End Sub
Private Sub proc(ByVal ParamArray arg As String())
End Sub
IMO, the compiler must be able to distinguish between them because it
depends on the *call* which procedure is called:
Dim s As String() = {"a", "b"}
proc(s)
proc("a", "b")
In the 1st call, the arg is a string-array, in the 2nd there are several
strings put into a string array. The result is the same, but the call is
obviously different. I think this is not ambiguous for the compiler.
why can't I overload these procedures?
Private Sub proc(ByVal arg As String())
End Sub
Private Sub proc(ByVal ParamArray arg As String())
End Sub
IMO, the compiler must be able to distinguish between them because it
depends on the *call* which procedure is called:
Dim s As String() = {"a", "b"}
proc(s)
proc("a", "b")
In the 1st call, the arg is a string-array, in the 2nd there are several
strings put into a string array. The result is the same, but the call is
obviously different. I think this is not ambiguous for the compiler.