SkipLocalsInit
is an unsafe operation, but does not give warning FS0009
#17116
Labels
Milestone
SkipLocalsInit
is an unsafe operation, but does not give warning FS0009
#17116
Applying the attribute
SkipLocalsInitAttribute
is an unsafe operation, but does not raise the FS0009 warning.Repro steps
Expected behavior
According to the docs, this is an unsafe operation.
F# issues the FS0009 warning for unsafe operations (like
fixed
and usingnativeptr
and the like). This warning should be thrown when usingSkipLocalsInit
as well.This is akin to using the
unsafe
keyword in C#, which is indeed required for this attribute.Actual behavior
The warning is not thrown.
Related information
The suggestion does not mention the term
unsafe
, but @dsyme mentionedwhich further cements that this is unsafe and that FS0009 should be shown here.
Since this is just a warning, I hope this can be added to F# still, without being considered a backward compatibility issue.
The text was updated successfully, but these errors were encountered: