DIP 1003: remove `body` as a keyword

Sönke Ludwig via Digitalmars-d-announce digitalmars-d-announce at puremagic.com
Fri Nov 25 13:18:56 PST 2016


Am 25.11.2016 um 12:39 schrieb Timon Gehr:
> On 24.11.2016 10:24, Kagamin wrote:
>> I see no ambiguity even if parsing is not greedy.
>
> import std.stdio;
> pragma(mangle,"_D2tt4mainFZ3fooUZv")
> void foo()in{ assert(true); }{
>     writeln("Hello World!");
> }
> void main(){
>     static extern(C) void foo()in{ assert(true); }
>     { foo(); }
> }
>
> Removing contracts, is this this code (printing "Hello World!"):
>
> import std.stdio;
> pragma(mangle,"_D2tt4mainFZ3fooUZv")
> void foo(){
>     writeln("Hello World!");
> }
> void main(){
>     static extern(C) void foo();
>     { foo(); }
> }

Not without explicitly adding that ";".


More information about the Digitalmars-d-announce mailing list