Ejemplo n.º 1
0
        void VerifyVisibility(SourceObject owner, Visibility visibility, DataType dt)
        {
            if (Backend.Has(TypeOptions.IgnoreProtection) &&
                Environment.IsGeneratingCode)
            {
                return;
            }

            if (VerifyAccessibleEntity(owner.Source, dt) &&
                !visibility.IsVisibile(dt))
            {
                Log.Error(owner.Source, ErrorCode.E4128, dt.Quote() + " is less accessible than " + owner.Quote());
            }
            else if (dt.IsGenericParameterization)
            {
                foreach (var pt in dt.GenericArguments)
                {
                    VerifyVisibility(owner, visibility, pt);
                }
            }
        }
Ejemplo n.º 2
0
 void VerifyModifiers(SourceObject e, Modifiers modifiers, Modifiers allowedModifiers)
 {
     if ((modifiers & ~allowedModifiers) != 0)
     {
         Log.Error(e.Source, ErrorCode.E4001, (modifiers & ~allowedModifiers).ToLiteral().Quote() + " is not valid for " + e.Quote());
     }
 }
Ejemplo n.º 3
0
 void VerifyVisibility(SourceObject owner, Visibility visibility, DataType dt)
 {
     if (VerifyAccessibleEntity(owner.Source, dt) &&
         !visibility.IsVisibile(dt) && (
             !Environment.IsGeneratingCode ||
             !Backend.Has(TypeOptions.IgnoreProtection)))
     {
         Log.Error(owner.Source, ErrorCode.E4128, dt.Quote() + " is less accessible than " + owner.Quote());
     }
 }