Bug 35410

Summary: Unexpected symbol 'sbyte' error when casting sbyte to predefined type (e.g. Int32) instead of C# keyword
Product: [Mono] Compilers Reporter: Alexander Köplinger [MSFT] <alkpli>
Component: C#Assignee: Marek Safar <masafa>
Severity: normal CC: mono-bugs+mono
Priority: ---    
Version: unspecified   
Target Milestone: ---   
Hardware: All   
OS: All   
Tags: Is this bug a regression?: ---
Last known good build:

Description Alexander Köplinger [MSFT] 2015-10-30 13:07:31 UTC
>using System;
>public class Program {
>    public static void Main() {
>        Int32 i = (Int32)sbyte.MaxValue;
>        Console.WriteLine(i);
>    }

>$ mcs test.cs 
>test.cs(4,25): error CS1525: Unexpected symbol `sbyte'
>Compilation failed: 1 error(s), 0 warnings

Adding parenthesis around sbyte.MaxValue makes the compilation succeed.

Repros on Mono 4.0 and master.
Comment 1 Marek Safar 2015-11-02 05:07:38 UTC
Fixed in master