February 16, 2003
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
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
"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
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
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
Fixed. -Walter


February 19, 2003
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


February 19, 2003
Forgot to mention: the error message gave no file or line number.

Dan

In article <b30sse$kp3$1@digitaldaemon.com>, Walter says...
>
>Fixed. -Walter
>
>


1 2
Next ›   Last »