使用片假名点的c​​onst变量名称 [英] Const variable name with katakana dot

查看:82
本文介绍了使用片假名点的c​​onst变量名称的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

美好的一天,



我想问...



我遇到了这段代码我尝试在VS 2013中运行它没关系..



Hi Good Day,

I would like to ask..

I met this code and I tried to run in VS 2013 in it is okay..

public const string my●var  = " "; 





但是当我试图在VS 2015中运行时,



请救命。谢谢。



我尝试过:



已经研究过const变量名带点..但找不到任何..



+++

使用VS 2013 Express时没有错误,错误在VS 2012或2015



But when I tried to run in VS 2015,

Please help. Thanks.

What I have tried:

Already researched about const variable name with dot.. but can't find any..

+++
No error when using VS 2013 Express, Errors on VS 2012, or 2015

推荐答案

如果此代码在2012年和2013年编译(我怀疑),那么它就是一个bug ...

根据C#规范,这样的符号不能是变量名称的一部分(参见2.4.2标识符)......

确保它不在2008/2010/2015编译。 ..
If this code compiles on 2012 and 2013 (I doubt that), than it is a bug...
According to C# specification such a sign can not be part of of a variable name (see 2.4.2 Identifiers)...
For sure it does not compile in 2008/2010/2015...


只是为了完成彼得所说的:该代码不能在VS2013下编译:

Just to complete what Peter says: that code doesn't compile under VS2013 either:
Error	1	Unexpected character '●'



它不是C#中变量名中的合法字符。


It's not a legal character in variable names in C# of whatever vintage.


这篇关于使用片假名点的c​​onst变量名称的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆