February 16, 2003 Re: DMD 0.54 release | ||||
---|---|---|---|---|
| ||||
Posted in reply to Walter | and another bug ... delegates don't take into account out params. the following compiles but crashes (as you would expect) int delegate( out int ) can be passed as int delegate( int ). alias int delegate( int foo ) MyCB; class CBHolder { MyCB cb; this( MyCB cb0 ) { cb = cb0; } int evoke( out int foo ) { return cb( foo ); } } class Test { int a,b; this() { CBHolder h = new CBHolder( &this.func ); a = h.evoke( b ); } int func( out int foo ) { foo = 9; return 3; } } int main( char[][] args ) { printf("begin\n"); Test t = new Test(); printf("test a:%d b:%d\n", t.a, t.b ); return 0; } "Walter" <walter@digitalmars.com> wrote in message news:b2l2oh$1o27$1@digitaldaemon.com... > Some long overdue syntax changes. Will break some existing code, but it's easy to fix. > > www.digitalmars.com/d/changelog.html > > > |
February 16, 2003 Re: DMD 0.54 release | ||||
---|---|---|---|---|
| ||||
Posted in reply to Walter | Duplicate cases not spotted (should they be ?) char[] func( int a ) { switch( a ) { case 0: return "None"; case 1: return "One"; case 0: return "None0"; default: return "-err-"; } } int main( char[][] args ) { for( int i = 0; i < 3; i++ ) { printf('i:%d "%.*s"'\n, i, func(i) ); } return 0; } "Walter" <walter@digitalmars.com> wrote in message news:b2l2oh$1o27$1@digitaldaemon.com... > Some long overdue syntax changes. Will break some existing code, but it's easy to fix. > > www.digitalmars.com/d/changelog.html > > > |
February 16, 2003 Re: DMD 0.54 release | ||||
---|---|---|---|---|
| ||||
Posted in reply to Mike Wynn | "Mike Wynn" <mike.wynn@l8night.co.uk> wrote in message news:b2ondj$200b$1@digitaldaemon.com... > Duplicate cases not spotted (should they be ?) Yes, they should be. It's a bug. -Walter |
February 19, 2003 Re: DMD 0.54 release | ||||
---|---|---|---|---|
| ||||
Posted in reply to Walter | The following causes the compiler to blow up with a null pointer reference. void foo() { struct Test { int i; bit bar(int a) { i = a; } } Test t; } int main(char[][] argv) { return 0; } |
February 19, 2003 Re: DMD 0.54 release | ||||
---|---|---|---|---|
| ||||
Posted in reply to Walter | Did something happen to local 2d arrays? I try to compile: int main (char argv[][], int argc) { int[3][4] a; return 0; } and I get "cannot implicitly convert int to int[3]". Dan L. In article <b2l2oh$1o27$1@digitaldaemon.com>, Walter says... > >Some long overdue syntax changes. Will break some existing code, but it's easy to fix. > >www.digitalmars.com/d/changelog.html > > > |
February 19, 2003 Re: DMD 0.54 release | ||||
---|---|---|---|---|
| ||||
Posted in reply to Dan L. | Fixed. -Walter |
February 19, 2003 Re: DMD 0.54 release | ||||
---|---|---|---|---|
| ||||
Posted in reply to Patrick Down | This is a more general bug in that structs/classes local to a function currently cannot have member functions. It's a compiler bug. -Walter |
Copyright © 1999-2021 by the D Language Foundation