C # 7.0 does not support binary literal, although MSDN claims to support

I am using C # 7.0

I have the following code:

using System;
using System.Collections.Generic;
using System.Linq;

namespace myApp {
    class Program {
        static void Main () {
            int myValue = 0b0010_0110_0000_0011;
            Console.WriteLine(myValue);
        }
    }
}

When compiling, it gives an error:

error CS1525: unexpected character "b0010_0110_0000_0011"

Why is this error coming? Because according to MSDN in C # 7.0, this is a valid syntax because it supports binary literals.

NOTE:

I am using a mono beta from the repository http://www.mono-project.com/download/beta/ for Ubuntu Xenial

According to http://www.mono-project.com/docs/about-mono/releases/5.0.0/ the last mono includes support for C # 7.0

+4
source share

Source: https://habr.com/ru/post/1691048/


All Articles