Skip to content

Commit

Permalink
Remove string case since it gets a canonical instantiation sometimes …
Browse files Browse the repository at this point in the history
…depending on optimization settings.
  • Loading branch information
jkoritzinsky committed Jul 12, 2021
1 parent dc63430 commit 26fc4d1
Showing 1 changed file with 1 addition and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -232,11 +232,10 @@ public void OffsetOf_Field_Generic()
Assert.Equal((IntPtr)4, Marshal.OffsetOf<Point2<float>>(nameof(Point2<int>.y)));
Assert.Equal((IntPtr)8, Marshal.OffsetOf<Point2<double>>(nameof(Point2<int>.y)));

// [COMPAT] Non-blittable generic types are supported in OffsetOf since they've always been allowed
// [COMPAT] Non-blittable generic types with value-type generic arguments are supported in OffsetOf since they've always been allowed
// and it likely doesn't meet the bar to break back-compat.
Assert.Equal((IntPtr)1, Marshal.OffsetOf<Point2<char>>(nameof(Point2<int>.y)));
Assert.Equal((IntPtr)1, Marshal.OffsetOf<Point2<byte>>(nameof(Point2<int>.y)));
Assert.Equal((IntPtr)IntPtr.Size, Marshal.OffsetOf<Point2<string>>(nameof(Point2<int>.y)));
}

public class NonRuntimeType : Type
Expand Down

0 comments on commit 26fc4d1

Please sign in to comment.