Author: miguel
Date: 2008-02-15 15:18:14 -0500 (Fri, 15 Feb 2008)
New Revision: 95821

Added:
   trunk/mcs/errors/cs1002-4.cs
Modified:
   trunk/mcs/mcs/ChangeLog
   trunk/mcs/mcs/cs-tokenizer.cs
Log:
2008-02-15  Miguel de Icaza  <[EMAIL PROTECTED]>

        * cs-tokenizer.cs: if a conditional expression happens inside a
        (...) this also means that we do not need to de-ambiguate between
        an parenthesized expression and a cast.  

        Fixes 346484.



Added: trunk/mcs/errors/cs1002-4.cs
===================================================================
--- trunk/mcs/errors/cs1002-4.cs        2008-02-15 20:17:11 UTC (rev 95820)
+++ trunk/mcs/errors/cs1002-4.cs        2008-02-15 20:18:14 UTC (rev 95821)
@@ -0,0 +1,8 @@
+class MainClass
+{
+        static void Main ()
+        {
+                System.Console.WriteLine((true ? "" : "") "text");      
+        }
+}
+


Property changes on: trunk/mcs/errors/cs1002-4.cs
___________________________________________________________________
Name: svn:eol-style
   + native

Modified: trunk/mcs/mcs/ChangeLog
===================================================================
--- trunk/mcs/mcs/ChangeLog     2008-02-15 20:17:11 UTC (rev 95820)
+++ trunk/mcs/mcs/ChangeLog     2008-02-15 20:18:14 UTC (rev 95821)
@@ -1,5 +1,11 @@
 2008-02-15  Miguel de Icaza  <[EMAIL PROTECTED]>
 
+       * cs-tokenizer.cs: if a conditional expression happens inside a
+       (...) this also means that we do not need to de-ambiguate between
+       an parenthesized expression and a cast.  
+
+       Fixes 346484.
+
        * constant.cs (SideEffectConstant): a constant value that happens
        to have a side effect.   
 

Modified: trunk/mcs/mcs/cs-tokenizer.cs
===================================================================
--- trunk/mcs/mcs/cs-tokenizer.cs       2008-02-15 20:17:11 UTC (rev 95820)
+++ trunk/mcs/mcs/cs-tokenizer.cs       2008-02-15 20:18:14 UTC (rev 95821)
@@ -971,8 +971,10 @@
                {
                        putback (')');
 
-                       // When any binary operation is used we are sure it is 
not a cast
-                       if (expression is Binary)
+                       // When any binary operation, a conditional is used we 
are sure it is not a cast
+                       // maybe more.
+                       
+                       if (expression is Binary || expression is Conditional)
                                return;
 
                        deambiguate_close_parens++;

_______________________________________________
Mono-patches maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches

Reply via email to