diff options
author | Jon Skeet <jonskeet@google.com> | 2017-11-16 18:20:01 +0000 |
---|---|---|
committer | Jon Skeet <jonskeet@google.com> | 2018-03-27 08:42:27 +0100 |
commit | 8e23d4e49c69385537869ed1332d52317c904d59 (patch) | |
tree | b0fe3db688b79b77482b6b1d655397426c47329e /csharp/src/Google.Protobuf/ByteArray.cs | |
parent | aa59eaa77b8ede7b0ed120e9bda8a92348ede946 (diff) | |
download | protobuf-8e23d4e49c69385537869ed1332d52317c904d59.tar.gz protobuf-8e23d4e49c69385537869ed1332d52317c904d59.tar.bz2 protobuf-8e23d4e49c69385537869ed1332d52317c904d59.zip |
Work around an "old runtime" issue with reflection
For oneofs, to get the case, we need to call the property that
returns the enum value. We really want it as an int, and modern
runtimes allow us to create a delegate which returns an int from the
method. (I suspect that the MS runtime has always allowed that.)
Old versions of Mono (e.g. used by Unity3d) don't allow that, so we
have to convert the enum value to an int via boxing. It's ugly, but
it should work.
Diffstat (limited to 'csharp/src/Google.Protobuf/ByteArray.cs')
0 files changed, 0 insertions, 0 deletions