Thread overview | ||||||
---|---|---|---|---|---|---|
|
January 27, 2006 Block Statement scope | ||||
---|---|---|---|---|
| ||||
Hi all, The examples func2() and func3() from http://www.digitalmars.com/d/statement.html compile without any warning, where it should be an error. -- Marcio Faustino |
January 27, 2006 Re: Block Statement scope | ||||
---|---|---|---|---|
| ||||
Posted in reply to Marcio Faustino | In article <drcmmp$kuh$1@digitaldaemon.com>, Marcio Faustino says... > >Hi all, > >The examples func2() and func3() from >http://www.digitalmars.com/d/statement.html compile without any warning, where >it should be an error. IIRC, from a long discussion in the D newsgroup, it was later decided that func3 should be legal code, while func2 and func4 should issue an error. Ciao --- http://www.mariottini.net/roberto/ |
January 27, 2006 Re: Block Statement scope | ||||
---|---|---|---|---|
| ||||
Posted in reply to Roberto Mariottini | In article <drcpts$o9s$1@digitaldaemon.com>, Roberto Mariottini says... > >In article <drcmmp$kuh$1@digitaldaemon.com>, Marcio Faustino says... >> >>Hi all, >> >>The examples func2() and func3() from >>http://www.digitalmars.com/d/statement.html compile without any warning, where >>it should be an error. > >IIRC, from a long discussion in the D newsgroup, it was later decided that func3 should be legal code, while func2 and func4 should issue an error. > >Ciao >--- >http://www.mariottini.net/roberto/ > > Sorry I didn't know that, but still func2() should cause a compile error. -- Marcio Faustino |
February 16, 2006 Re: Block Statement scope | ||||
---|---|---|---|---|
| ||||
Posted in reply to Marcio Faustino | Marcio Faustino wrote: > In article <drcpts$o9s$1@digitaldaemon.com>, Roberto Mariottini says... >> In article <drcmmp$kuh$1@digitaldaemon.com>, Marcio Faustino says... >>> Hi all, >>> >>> The examples func2() and func3() from >>> http://www.digitalmars.com/d/statement.html compile without any warning, where >>> it should be an error. >> IIRC, from a long discussion in the D newsgroup, it was later decided that func3 should be legal code, while func2 and func4 should issue an error. >> >> Ciao >> --- >> http://www.mariottini.net/roberto/ >> >> > > Sorry I didn't know that, but still func2() should cause a compile error. Confirmed with dmd 0.147 on linux. func2() should produce an error, but it doesn't. There's also an error in the docs - func3() should be legal, because previous x is introduced in it's own scope inside the first block. -- Jari-Matti |
Copyright © 1999-2021 by the D Language Foundation