Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Remove string case since it gets a canonical instantiation sometimes …
…depending on optimization settings.
  • Loading branch information
jkoritzinsky committed Jul 12, 2021
commit 26fc4d16e2f302d541b97ccfa1c2ea87591a0eef
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