www.digitalmars.com         C & C++   DMDScript  

D - Bug or feature

reply "Daniel Yokomiso" <daniel_yokomiso yahoo.com.br> writes:
Hi,

    The following piece of code stopped working from 0.72 to 0.73:


int main() {
    int _closure() {return 12987;};
    int delegate() _delegate = _closure;
    return 0;
}


    The compiler says: "test.d(3): cannot implicitly convert int to int
delegate()". Is it an error or something changed in delegates (there's
nothing in the changelog)?

    Best regards,
    Daniel Yokomiso.

"We all begin life naked, covered in blood, and screaming.  But if we live
right, it doesn't have to stop there."
 - Robert A. Heinlein





---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.520 / Virus Database: 318 - Release Date: 18/9/2003
Sep 19 2003
next sibling parent reply "Charles Sanders" <sanders-consulting comcast.net> writes:
I love those quotes :).  I am a big fan of HeinLein too.

Charles
"Daniel Yokomiso" <daniel_yokomiso yahoo.com.br> wrote in message
news:bkg4jk$140f$1 digitaldaemon.com...
 Hi,

     The following piece of code stopped working from 0.72 to 0.73:


 int main() {
     int _closure() {return 12987;};
     int delegate() _delegate = _closure;
     return 0;
 }


     The compiler says: "test.d(3): cannot implicitly convert int to int
 delegate()". Is it an error or something changed in delegates (there's
 nothing in the changelog)?

     Best regards,
     Daniel Yokomiso.

 "We all begin life naked, covered in blood, and screaming.  But if we live
 right, it doesn't have to stop there."
  - Robert A. Heinlein





 ---
 Outgoing mail is certified Virus Free.
 Checked by AVG anti-virus system (http://www.grisoft.com).
 Version: 6.0.520 / Virus Database: 318 - Release Date: 18/9/2003
Sep 19 2003
parent "Matthew Wilson" <matthew stlsoft.org> writes:
Indeed. Time Enough For Love is one of my favourite books. (The scary thing
is, I don't think I've read it since about 1988! Must do a re-run)


"Charles Sanders" <sanders-consulting comcast.net> wrote in message
news:bkg5a0$15qr$1 digitaldaemon.com...
 I love those quotes :).  I am a big fan of HeinLein too.

 Charles
 "Daniel Yokomiso" <daniel_yokomiso yahoo.com.br> wrote in message
 news:bkg4jk$140f$1 digitaldaemon.com...
 Hi,

     The following piece of code stopped working from 0.72 to 0.73:


 int main() {
     int _closure() {return 12987;};
     int delegate() _delegate = _closure;
     return 0;
 }


     The compiler says: "test.d(3): cannot implicitly convert int to int
 delegate()". Is it an error or something changed in delegates (there's
 nothing in the changelog)?

     Best regards,
     Daniel Yokomiso.

 "We all begin life naked, covered in blood, and screaming.  But if we
live
 right, it doesn't have to stop there."
  - Robert A. Heinlein





 ---
 Outgoing mail is certified Virus Free.
 Checked by AVG anti-virus system (http://www.grisoft.com).
 Version: 6.0.520 / Virus Database: 318 - Release Date: 18/9/2003
Sep 19 2003
prev sibling parent reply "Carlos Santander B." <carlos8294 msn.com> writes:
"Daniel Yokomiso" <daniel_yokomiso yahoo.com.br> wrote in message
news:bkg4jk$140f$1 digitaldaemon.com...
| Hi,
|
|     The following piece of code stopped working from 0.72 to 0.73:
|
|
| int main() {
|     int _closure() {return 12987;};
|     int delegate() _delegate = _closure;
|     return 0;
| }
|
|
|     The compiler says: "test.d(3): cannot implicitly convert int to int
| delegate()". Is it an error or something changed in delegates (there's
| nothing in the changelog)?
|
|     Best regards,
|     Daniel Yokomiso.
|

Delegates also need the & operator now (just like functions). I also had
that problem.

—————————————————————————
Carlos Santander
"Daniel Yokomiso" <daniel_yokomiso yahoo.com.br> wrote in message
news:bkg4jk$140f$1 digitaldaemon.com...
| Hi,
|
|     The following piece of code stopped working from 0.72 to 0.73:
|
|
| int main() {
|     int _closure() {return 12987;};
|     int delegate() _delegate = _closure;
|     return 0;
| }
|
|
|     The compiler says: "test.d(3): cannot implicitly convert int to int
| delegate()". Is it an error or something changed in delegates (there's
| nothing in the changelog)?
|
|     Best regards,
|     Daniel Yokomiso.
|

Delegates also need the & operator now (just like functions). I also had
that problem.

—————————————————————————
Carlos Santander
Sep 19 2003
parent "Daniel Yokomiso" <daniel_yokomiso yahoo.com.br> writes:
"Carlos Santander B." <carlos8294 msn.com> escreveu na mensagem
news:bkg5fp$16hj$1 digitaldaemon.com...
 Delegates also need the & operator now (just like functions). I also had
 that problem.
Thanks. --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.520 / Virus Database: 318 - Release Date: 18/9/2003
Sep 19 2003