【问题标题】:`using` as typedef causes CS1001`using` as typedef 导致 CS1001
【发布时间】:2017-01-03 12:05:07
【问题描述】:

怎么了

using T = int;

?

导致编译器错误CS 1001 Identifier expected

【问题讨论】:

    标签: c# compiler-errors typedef using


    【解决方案1】:

    你必须写

    using T = System.Int32;
    

    因为int 只是System.Int32 的简写,而这些简写没有在语言规范中实现(即,int 不是根据规范的标识符)。您需要提供完整的限定名称。

    【讨论】:

      猜你喜欢
      • 2016-03-21
      • 2014-07-14
      • 2011-12-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2023-02-18
      • 2012-12-17
      相关资源
      最近更新 更多