Missing readonly
on ref-local can result in ArrayTypeMismatchException
#3237
Labels
readonly
on ref-local can result in ArrayTypeMismatchException
#3237
Input code
Erroneous output
If collection initializers are disabled, or if the second argument is another complex expression that the decompiler transforms into multiple statements:
In the original code,
in arr[1]
translates toreadonly.ldelema
. In the decompiled code, we get a non-readonlyldelema
. This results in the decompiled program failing with ArrayTypeMismatchException when the original program was successful.A correct decompilation would use:
The text was updated successfully, but these errors were encountered: