Open mikernet opened 9 months ago
Combination of ref struct and ref parameters causes validation to fail for the code below. Making BinaryReader a normal non-ref struct or making the parameters non-ref causes the validation error to go away.
ref struct
ref
BinaryReader
struct
Sharplab link
ref struct BinaryReader {} static class IntProcessor { public static void Read(ref BinaryReader reader) { } } public static class Program { public static void Main() { BinaryReader reader = new(); IntProcessor.Read(ref reader); } }
.NET 8.0.0
Description
Combination of
ref struct
andref
parameters causes validation to fail for the code below. MakingBinaryReader
a normal non-refstruct
or making the parameters non-ref causes the validation error to go away.Reproduction Steps
Sharplab link
Configuration
.NET 8.0.0