dotgnu-pnet-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Dotgnu-pnet-commits] CVS: pnet/cscc/csharp cs_modifiers.c,1.3,1.4


From: Rhys Weatherley <address@hidden>
Subject: [Dotgnu-pnet-commits] CVS: pnet/cscc/csharp cs_modifiers.c,1.3,1.4
Date: Tue, 05 Nov 2002 17:38:59 -0500

Update of /cvsroot/dotgnu-pnet/pnet/cscc/csharp
In directory subversions:/tmp/cvs-serv26005/cscc/csharp

Modified Files:
        cs_modifiers.c 
Log Message:


ValidateCalling: report an error if a virtual or abstract method
is declared private.


Index: cs_modifiers.c
===================================================================
RCS file: /cvsroot/dotgnu-pnet/pnet/cscc/csharp/cs_modifiers.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -r1.3 -r1.4
*** cs_modifiers.c      18 Mar 2002 05:59:02 -0000      1.3
--- cs_modifiers.c      5 Nov 2002 22:38:55 -0000       1.4
***************
*** 534,538 ****
   * Validate calling conventions for a method-like construct.
   */
! static ILUInt32 ValidateCalling(ILNode *node, ILUInt32 modifiers)
  {
        ILUInt32 attrs = 0;
--- 534,539 ----
   * Validate calling conventions for a method-like construct.
   */
! static ILUInt32 ValidateCalling(ILNode *node, ILUInt32 modifiers,
!                                                               ILUInt32 access)
  {
        ILUInt32 attrs = 0;
***************
*** 627,630 ****
--- 628,642 ----
        }
  
+       /* Virtual methods cannot be private */
+       if((modifiers & (CS_MODIFIER_ABSTRACT | CS_MODIFIER_VIRTUAL |
+                                        CS_MODIFIER_OVERRIDE)) != 0)
+       {
+               if(access == IL_META_FIELDDEF_PRIVATE)
+               {
+                       CCErrorOnLine(yygetfilename(node), yygetlinenum(node),
+                                 "cannot declare virtual or abstract methods 
to be private");
+               }
+       }
+ 
        /* Methods always need "hide by sig" */
        attrs |= IL_META_METHODDEF_HIDE_BY_SIG;
***************
*** 642,646 ****
  
        /* Process the calling convention attributes */
!       attrs |= ValidateCalling(node, modifiers);
  
        /* Process the other method modifiers */
--- 654,658 ----
  
        /* Process the calling convention attributes */
!       attrs |= ValidateCalling(node, modifiers, attrs);
  
        /* Process the other method modifiers */
***************
*** 673,677 ****
  
        /* Process the calling convention attributes */
!       attrs |= ValidateCalling(node, modifiers);
  
        /* Process the other property modifiers */
--- 685,689 ----
  
        /* Process the calling convention attributes */
!       attrs |= ValidateCalling(node, modifiers, attrs);
  
        /* Process the other property modifiers */
***************
*** 703,707 ****
  
        /* Process the calling convention attributes */
!       attrs |= ValidateCalling(node, modifiers);
  
        /* Process the other property modifiers */
--- 715,719 ----
  
        /* Process the calling convention attributes */
!       attrs |= ValidateCalling(node, modifiers, attrs);
  
        /* Process the other property modifiers */





reply via email to

[Prev in Thread] Current Thread [Next in Thread]