New analyzer:
For methods that that are overloaded with different signatures where many of the arguments are of the same type it can often be hard to be sure that you are calling the right one
Perhaps we could detect cases where there are several methods of the same name with long argument lists and offer to convert the calls so that named arguments are used
Before:
function a(q as double, w as double, e as double, r as double) as double
...
end function
function a(q as double, w as double, r as double) as double
...
end function
dim b = a(1,2,3,4)
dim c = a(1,2,4)
After:
function a(q as double, w as double, e as double, r as double) as double
...
end function
function a(q as double, w as double, r as double) as double
...
end function
dim b = a(q:=1, w:=2, e:=3, r:=4)
dim c = a(q:=1,w:=2, r:=4)
Exactly what counts as too long, too confusing etc., is of course an open question.
The reason for this request is a bug I introduced while refactoring and removing an unused argument.
Diagnostic Id: CC0123
Category: <Reliability>
Severity: Warning
New analyzer:
For methods that that are overloaded with different signatures where many of the arguments are of the same type it can often be hard to be sure that you are calling the right one
Perhaps we could detect cases where there are several methods of the same name with long argument lists and offer to convert the calls so that named arguments are used
Before:
After:
Exactly what counts as too long, too confusing etc., is of course an open question.
The reason for this request is a bug I introduced while refactoring and removing an unused argument.
Diagnostic Id:
CC0123Category:
<Reliability>Severity:
Warning