Skip to content

.NET9 ScriptRange Add NotSupportedException: Collection was of a fixed size #585

@user-named-void

Description

@user-named-void

When migrating to .NET9 we found an issue with the array.add function. Using an array.add on a non existing list we get an error 'Collection was of a fixed size'
arr = arr | array.add 1

If the list is null, the array.add function tries to create a new ScriptRange with the new value, but this fails with the NotSupportedException.

return new ScriptRange { value };

Switching back to .NET8 fixes the issue.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions