[mcs] Better detection of null operator inside conditional expression. Fixes #57232
[mono.git] / mcs / mcs / cs-tokenizer.cs
index afa69c86a4bc307d083b9c8b0b9373a178ff2aa8..1be3309b1bfdd611d404408e743e0414f81f2860 100644 (file)
@@ -899,7 +899,6 @@ namespace Mono.CSharp
                                case Token.ARROW:
                                case Token.OP_COALESCING:
                                case Token.INTERR:
-                               case Token.COLON:
                                        res = Token.THROW_EXPR;
                                        break;
                                }
@@ -1326,7 +1325,8 @@ namespace Mono.CSharp
                        }
 
                        if (d == '.') {
-                               return Token.INTERR_OPERATOR;
+                               d = reader.Peek ();
+                               return d >= '0' && d <= '9' ? Token.INTERR : Token.INTERR_OPERATOR;
                        }
 
                        if (d != ' ') {