diff options
author | Jb Evain <jbevain@gmail.com> | 2014-04-14 12:54:04 +0400 |
---|---|---|
committer | Jb Evain <jbevain@gmail.com> | 2014-05-27 13:43:45 +0400 |
commit | 254a00fb5a9793936beb641403d086421f2157da (patch) | |
tree | d176c18e750a0d8b49c16e6a15eadcec67ed1d0f /Mono.Cecil/AssemblyWriter.cs | |
parent | 0dc6421feffaf3a6b69b0fbb4d109fc7fe6948dc (diff) |
Fix writing of nullable primitive constants
Diffstat (limited to 'Mono.Cecil/AssemblyWriter.cs')
-rw-r--r-- | Mono.Cecil/AssemblyWriter.cs | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/Mono.Cecil/AssemblyWriter.cs b/Mono.Cecil/AssemblyWriter.cs index 0597bc0..7d0a580 100644 --- a/Mono.Cecil/AssemblyWriter.cs +++ b/Mono.Cecil/AssemblyWriter.cs @@ -1640,6 +1640,11 @@ namespace Mono.Cecil { case ElementType.Var: return ElementType.Class; case ElementType.GenericInst: + var generic_instance = (GenericInstanceType) constant_type; + if (generic_instance.ElementType.IsTypeOf ("System", "Nullable`1")) + return GetConstantType (generic_instance.GenericArguments [0], constant); + + return GetConstantType (((TypeSpecification) constant_type).ElementType, constant); case ElementType.CModOpt: case ElementType.CModReqD: case ElementType.ByRef: |