1. Describe the bug
For List variables that are either a list of interfaces or even a list of codeunits that contain an interface as a global variable, AddRange is unstable. Specifically it throws an unhandled CLR exception when the list in the parameter is empty.
2. To Reproduce
- Define a list of interfaces
- Define another list of interfaces
- Call AddRange, passing the empty list of interfaces
[Test]
procedure AddRange_Passes_WhenListIsEmpty()
var
BaseList: List of [Interface "AOAI Function"];
EmptyList: List of [Interface "AOAI Function"];
begin
// Fails with CLR exception
BaseList.AddRange(EmptyList);
end;
3. Expected behavior
AddRange successfully does nothing when the provided list is empty, regardless of type.
4. Actual behavior
CLR exception when the provided list of interfaces is empty.
5. Versions:
Occurs using artifacts from this URL: https://bcartifacts-exdbf9fwegejdqak.b02.azurefd.net/sandbox/27.5.46862.47203/us
Also occurs using the latest AL runtime with AL Language version = 18.0.2293710
1. Describe the bug
For
Listvariables that are either a list of interfaces or even a list of codeunits that contain an interface as a global variable,AddRangeis unstable. Specifically it throws an unhandled CLR exception when the list in the parameter is empty.2. To Reproduce
[Test] procedure AddRange_Passes_WhenListIsEmpty() var BaseList: List of [Interface "AOAI Function"]; EmptyList: List of [Interface "AOAI Function"]; begin // Fails with CLR exception BaseList.AddRange(EmptyList); end;3. Expected behavior
AddRangesuccessfully does nothing when the provided list is empty, regardless of type.4. Actual behavior
CLR exception when the provided list of interfaces is empty.
5. Versions:
Occurs using artifacts from this URL: https://bcartifacts-exdbf9fwegejdqak.b02.azurefd.net/sandbox/27.5.46862.47203/us
Also occurs using the latest AL runtime with AL Language version = 18.0.2293710