Exemple #1
0
        /// <summary>
        /// the same as GetIncompleteForwardDeclaration, but throws no exception if not found
        /// </summary>
        private TypeBuilder GetIncompleteForwardDeclartionUnchecked(Symbol typeSymbol)
        {
            TypeContainer container = (TypeContainer)m_fwdDeclaredTypes[typeSymbol];
            TypeBuilder   result    = (container != null ? container.GetCompactClsType() as TypeBuilder : null);

            return(result);
        }
Exemple #2
0
 public bool IsAssignableTo(TypeContainer type)
 {
     if (type.GetCompactClsType().Equals(ReflectionHelper.ByteType))
     {
         return(m_value >= SByte.MinValue && m_value <= Byte.MaxValue);
     }
     else if (type.GetCompactClsType().Equals(ReflectionHelper.Int16Type))
     {
         if (type.GetAssignableFromType().Equals(typeof(UInt16)))
         {
             return(m_value >= UInt16.MinValue && m_value <= UInt16.MaxValue);
         }
         else
         {
             return(m_value >= Int16.MinValue && m_value <= Int16.MaxValue);
         }
     }
     else if (type.GetCompactClsType().Equals(ReflectionHelper.Int32Type))
     {
         if (type.GetAssignableFromType().Equals(typeof(UInt32)))
         {
             return(m_value >= UInt32.MinValue && m_value <= UInt32.MaxValue);
         }
         else
         {
             return(m_value >= Int32.MinValue && m_value <= Int32.MaxValue);
         }
     }
     else if (type.GetCompactClsType().Equals(ReflectionHelper.Int64Type))
     {
         if (type.GetAssignableFromType().Equals(typeof(UInt64)))
         {
             return(m_value >= UInt64.MinValue && m_value <= UInt64.MaxValue);
         }
         else
         {
             return(m_value >= Int64.MinValue && m_value <= Int64.MaxValue);
         }
     }
     else
     {
         return(false);
     }
 }
Exemple #3
0
        /// <summary>
        /// returns the typebuilder if found among types in creation, otherwise throws exception
        /// </summary>
        private TypeBuilder GetTypeFromTypesInCreation(Symbol typeSymbol)
        {
            TypeContainer container  = (TypeContainer)m_typesInCreation[typeSymbol];
            TypeBuilder   toComplete = (container != null ? container.GetCompactClsType() as TypeBuilder : null);

            if (toComplete != null)
            {
                return(toComplete);
            }
            else
            {
                throw new InternalCompilerException("type in creation not found: " + typeSymbol);
            }
        }
Exemple #4
0
 public bool IsAssignableTo(TypeContainer type)
 {
     return(type.GetCompactClsType().Equals(ReflectionHelper.StringType));
 }
Exemple #5
0
 public bool IsAssignableTo(TypeContainer type)
 {
     return(type.GetCompactClsType().IsEnum);
 }