• Jon Skeet's avatar
    Work around an "old runtime" issue with reflection · 8e23d4e4
    Jon Skeet authored
    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.
    8e23d4e4
ReflectionUtil.cs 8.41 KB