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_lvalue.tc,1.36,1.37


From: Rhys Weatherley <address@hidden>
Subject: [Dotgnu-pnet-commits] CVS: pnet/cscc/csharp cs_lvalue.tc,1.36,1.37
Date: Wed, 26 Feb 2003 18:03:21 -0500

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

Modified Files:
        cs_lvalue.tc 
Log Message:


ILNode_MemberAccess: do a trial lookup to handle properties and enumerated
types that have the same name, and to avoid the instance method check on
the property.


Index: cs_lvalue.tc
===================================================================
RCS file: /cvsroot/dotgnu-pnet/pnet/cscc/csharp/cs_lvalue.tc,v
retrieving revision 1.36
retrieving revision 1.37
diff -C2 -r1.36 -r1.37
*** cs_lvalue.tc        26 Feb 2003 05:09:50 -0000      1.36
--- cs_lvalue.tc        26 Feb 2003 23:03:19 -0000      1.37
***************
*** 1041,1044 ****
--- 1041,1046 ----
        ILEvalValue evalue;
        ILNode *save1;
+       ILProperty *property;
+       ILType *type;
  
        /*  PART I  - Try it in the usual fashion  */
***************
*** 1047,1050 ****
--- 1049,1071 ----
        save1 = node->expr1;
  
+       /* Hack: check for properties with enumerated types in the left
+          part of the member reference.  If we find one, then this is
+          an enumerated constant value, not a property */
+       if(yyisa(node->expr1, ILNode_Identifier))
+       {
+               value = CSResolveSimpleNameQuiet
+                       (info, node->expr1, ((ILNode_Identifier 
*)(node->expr1))->name, 0);
+               if(CSSemIsProperty(value))
+               {
+                       property = CSSemGetProperty(value);
+                       type = ILTypeGetReturn(ILProperty_Signature(property));
+                       if(ILTypeIsEnum(type))
+                       {
+                               CSSemSetType(value, type);
+                               goto skipLeft;
+                       }
+               }
+       }
+ 
        /* Get the semantic value for the left part of the identifier */
        value = ILNode_SemAnalysis(node->expr1, info, &(node->expr1));
***************
*** 1067,1070 ****
--- 1088,1092 ----
        }
  
+ skipLeft:
        /* Convert the second subexpression into a name */
        name = ILQualIdentName(node->expr2, 0);





reply via email to

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