`
oldrev
  • 浏览: 229912 次
  • 性别: Icon_minigender_1
  • 来自: 昆明
社区版块
存档分类
最新评论

D语言 struct constrcutor 的 bug

阅读更多

今天有空测试了一下 D语言 2.0 最新增加的 struct constructor 特性,结果刚来就发现一个大 bug:

import std.stdio;

struct Foo
{
    int x;
    int y;
}

void main()
{
    Foo f3 = 123;
}

 上面这个程序居然能在 DMD 2.019 的编译器上编译通过,真是不可思议。

分享到:
评论
1 楼 Colorful 2008-09-06  
Wow, this is amazing.

相关推荐

Global site tag (gtag.js) - Google Analytics