ITeye博客

D语言 struct constrcutor 的 bug

oldrev · 2008-09-06 14:01 · Markdown

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

import std.stdio;

struct Foo
{
    int x;
    int y;
}

void main()
{
    Foo f3 = 123;
}

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

评论(1)

  1. #1 楼 · Colorful · 2008-09-06 22:47

    Wow, this is amazing.

评论功能维护中,当前仅展示历史评论。