Exemple #1
0
 protected internal void SetExitTypeDescriptor(string descriptor)
 {
     // If this property or field access would return a primitive - and yet
     // it is also marked null safe - then the exit type descriptor must be
     // promoted to the box type to allow a null value to be passed on
     if (_nullSafe && CodeFlow.IsPrimitive(descriptor))
     {
         _originalPrimitiveExitTypeDescriptor = descriptor;
         _exitTypeDescriptor = CodeFlow.ToBoxedDescriptor(descriptor);
     }
     else
     {
         _exitTypeDescriptor = descriptor;
     }
 }
Exemple #2
0
        private void UpdateExitTypeDescriptor()
        {
            var executorToCheck = _cachedExecutor;

            if (executorToCheck != null && executorToCheck.Get() is ReflectiveMethodExecutor)
            {
                var method     = ((ReflectiveMethodExecutor)executorToCheck.Get()).Method;
                var descriptor = CodeFlow.ToDescriptor(method.ReturnType);
                if (_nullSafe && CodeFlow.IsPrimitive(descriptor))
                {
                    _originalPrimitiveExitTypeDescriptor = descriptor;
                    _exitTypeDescriptor = CodeFlow.ToBoxedDescriptor(descriptor);
                }
                else
                {
                    _exitTypeDescriptor = descriptor;
                }
            }
        }