www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - delegate type error

reply "John C" <johnch_atms hotmail.com> writes:
The following emits the wrong type information:

    int main() {

        int test(char[] s) {}

        auto del = &test;
        writelfn(typeof(typeid(del)).toString());

        return 0;
    }

This writes
    int delegate()
instead of
    int delegate(char[]) 
Oct 26 2005
next sibling parent "John C" <johnch_atms hotmail.com> writes:
"John C" <johnch_atms hotmail.com> wrote in message 
news:djni43$1a52$1 digitaldaemon.com...
 The following emits the wrong type information:

    int main() {

        int test(char[] s) {}

        auto del = &test;
        writelfn(typeof(typeid(del)).toString());
Of course, I meant to say writefln(typeid(typeof(del)).toString());
        return 0;
    }

 This writes
    int delegate()
 instead of
    int delegate(char[])
 
Oct 26 2005
prev sibling parent reply Thomas Kuehne <thomas-dloop kuehne.cn> writes:
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

John C schrieb am 2005-10-26:
 The following emits the wrong type information:

     int main() {

         int test(char[] s) {}

         auto del = &test;
         writelfn(typeof(typeid(del)).toString());

         return 0;
     }

 This writes
     int delegate()
 instead of
     int delegate(char[]) 
This isn't "auto" related, but a general problem with the TypeInfo of delegates. Thomas -----BEGIN PGP SIGNATURE----- iD8DBQFDYilL3w+/yD4P9tIRAsyMAKCdevq7++mnANgbu8o5h2KZoh0tMQCfVXCl mL9FVO3UFRLkCVLF80Egu9I= =vMT8 -----END PGP SIGNATURE-----
Oct 28 2005
parent "John C" <johnch_atms hotmail.com> writes:
"Thomas Kuehne" <thomas-dloop kuehne.cn> wrote in message 
news:b3m933-iu6.ln1 eiche.kuehne.cn...
 -----BEGIN PGP SIGNED MESSAGE-----
 Hash: SHA1

 John C schrieb am 2005-10-26:
 The following emits the wrong type information:

     int main() {

         int test(char[] s) {}

         auto del = &test;
         writelfn(typeof(typeid(del)).toString());

         return 0;
     }

 This writes
     int delegate()
 instead of
     int delegate(char[])
This isn't "auto" related, but a general problem with the TypeInfo of delegates.
I realise that. Hence the title of the post.
 Thomas

 -----BEGIN PGP SIGNATURE-----

 iD8DBQFDYilL3w+/yD4P9tIRAsyMAKCdevq7++mnANgbu8o5h2KZoh0tMQCfVXCl
 mL9FVO3UFRLkCVLF80Egu9I=
 =vMT8
 -----END PGP SIGNATURE----- 
Oct 29 2005