Remove TypedReference.MakeTypedReference readonly restriction (dotnet/coreclr#21193)
authorStephen Toub <stoub@microsoft.com>
Mon, 26 Nov 2018 19:08:38 +0000 (14:08 -0500)
committerJan Kotas <jkotas@microsoft.com>
Mon, 26 Nov 2018 19:08:38 +0000 (11:08 -0800)
commitedf9707a210aa223f8f7cff8ffb4f269e54832e5
tree6e079741e79673215f50d8d686a70ecbec50808a
parent97a0861b21e2bbd803151e8bc94bc8bb6510ca1d
Remove TypedReference.MakeTypedReference readonly restriction (dotnet/coreclr#21193)

TypedReference.MakeTypedReference validates that the fields aren't readonly, which limits our ability to make fields readonly in core while maintaining BinaryFormatter compatibility.  This restriction isn't useful for a variety of reasons, though: reflection allows readonly fields to be set, but more importantly, TypedReference.SetTypedReference has always thrown NotSupportedException, so it's not even actually usable.

This change just removes the readonly check from MakeTypedReference.

Commit migrated from https://github.com/dotnet/coreclr/commit/a6729dab35fde5d50fb12b06aeb77d3e1f3be872
src/coreclr/src/System.Private.CoreLib/Resources/Strings.resx
src/coreclr/src/System.Private.CoreLib/src/System/TypedReference.cs