Pchp.CodeAnalysis.FlowAnalysis.TypeRefContext.GetNullTypeMask C# (CSharp) Method

GetNullTypeMask() public method

Gets type mask corresponding to System.Object and not including any subclasses.
public GetNullTypeMask ( ) : TypeRefMask
return TypeRefMask
        public TypeRefMask GetNullTypeMask()
        {
            return GetTypeMask(NameUtils.SpecialNames.System_Object, false);
        }

Usage Example

コード例 #1
0
ファイル: BoundExpression.cs プロジェクト: iolevel/peachpie
        /// <summary>
        /// Gets type mask of the literal within given type context.
        /// </summary>
        internal TypeRefMask ResolveTypeMask(TypeRefContext typeCtx)
        {
            Debug.Assert(this.ConstantValue.HasValue);
            var value = this.ConstantValue.Value;

            if (value == null)
            {
                return typeCtx.GetNullTypeMask();
            }
            else
            {
                if (value is long || value is int)
                {
                    return typeCtx.GetLongTypeMask();
                }
                else if (value is string)
                {
                    return typeCtx.GetStringTypeMask();
                }
                else if (value is bool)
                {
                    return typeCtx.GetBooleanTypeMask();
                }
                else if (value is double)
                {
                    return typeCtx.GetDoubleTypeMask();
                }
                else
                {
                    throw new NotImplementedException();
                }
            }
        }
All Usage Examples Of Pchp.CodeAnalysis.FlowAnalysis.TypeRefContext::GetNullTypeMask