public IClrTypeReference Compile() { if (IsTypeNullable.HasValue || IsElementTypeNullable.HasValue) { Type rewritten = DotNetTypeInfoFactory.Rewrite( Type, !(IsTypeNullable ?? false), !(IsElementTypeNullable ?? false)); return(new ClrTypeReference(rewritten, Context)); } return(this); }
internal static void RewriteClrType( this FieldDescriptionBase fieldDescription, Func <Type, TypeReference> createContext) { if (fieldDescription.IsNullable.HasValue && fieldDescription.TypeReference.IsClrTypeReference()) { fieldDescription.TypeReference = createContext( DotNetTypeInfoFactory.Rewrite( fieldDescription.TypeReference.ClrType, !fieldDescription.IsNullable.Value, !fieldDescription.IsElementNullable.Value)); } }