digitalmars.D.bugs - Compiler crash?
- Regan Heath (13/13) Mar 25 2005 --[test27.d]--
- =?ISO-8859-15?Q?Thomas_K=FChne?= (32/32) Mar 25 2005 -----BEGIN PGP SIGNED MESSAGE-----
- Walter (4/6) Apr 05 2005 The circular reference to fn is what causes the crash. I've fixed the
- Regan Heath (4/10) Apr 05 2005 Ok. So how does one define/declare a function that returns a function?
- Walter (5/15) Apr 05 2005 It can return a function of a different type. It just can't return a
- Stewart Gordon (9/22) Apr 06 2005 So you can do stuff like
- Regan Heath (7/24) Apr 06 2005 Good question.. no idea :)
--[test27.d]--
typedef fn function() fn;
fn foo() { return &foo; }
void main()
{
fn p = foo();
p();
}
C:\Library\D\src\temp>dmd test27 -g -debug -unittest
C:\Library\D\src\temp>
The compiler exits with code -1073741819, prints nothing, produces no
files etc.
Regan
Mar 25 2005
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Regan Heath wrote:
| --[test27.d]--
| typedef fn function() fn;
|
| fn foo() { return &foo; }
|
| void main()
| {
| fn p = foo();
| p();
| }
|
| C:\Library\D\src\temp>dmd test27 -g -debug -unittest
|
| C:\Library\D\src\temp>
|
| The compiler exits with code -1073741819, prints nothing, produces no
| files etc.
|
| Regan
Added to DStress as
http://dstress.kuehne.cn/run/debug_info_01.d
http://dstress.kuehne.cn/run/debug_info_02.d
Thomas
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.0 (MingW32)
iD8DBQFCRCpL3w+/yD4P9tIRAt3eAKDN8fOsUDHGVNWEyGN/NoH3VKMYYACfYpfx
LJqAiucSuFUaQfH97nVfzGM=
=4jVC
-----END PGP SIGNATURE-----
Mar 25 2005
"Regan Heath" <regan netwin.co.nz> wrote in message news:opsn61vgpg23k2f5 nrage.netwin.co.nz...--[test27.d]-- typedef fn function() fn;The circular reference to fn is what causes the crash. I've fixed the compiler to now issue a diagnostic error for it.
Apr 05 2005
On Tue, 5 Apr 2005 15:42:56 -0700, Walter <newshound digitalmars.com> wrote:"Regan Heath" <regan netwin.co.nz> wrote in message news:opsn61vgpg23k2f5 nrage.netwin.co.nz...Ok. So how does one define/declare a function that returns a function? Regan--[test27.d]-- typedef fn function() fn;The circular reference to fn is what causes the crash. I've fixed the compiler to now issue a diagnostic error for it.
Apr 05 2005
"Regan Heath" <regan netwin.co.nz> wrote in message news:opsor7y7x523k2f5 nrage.netwin.co.nz...On Tue, 5 Apr 2005 15:42:56 -0700, Walter <newshound digitalmars.com> wrote:It can return a function of a different type. It just can't return a function of the same type. The only way to make the latter work is to use a cast, i.e. declare the function as returning void* and casting the result."Regan Heath" <regan netwin.co.nz> wrote in message news:opsn61vgpg23k2f5 nrage.netwin.co.nz...Ok. So how does one define/declare a function that returns a function?--[test27.d]-- typedef fn function() fn;The circular reference to fn is what causes the crash. I've fixed the compiler to now issue a diagnostic error for it.
Apr 05 2005
Regan Heath wrote:On Tue, 5 Apr 2005 15:42:56 -0700, Walter <newshound digitalmars.com> wrote:So you can do stuff like fn qwert; qwert = qwert(); You've got me wondering how this could be used in practice.... Stewart. -- My e-mail is valid but not my primary mailbox. Please keep replies on the 'group where everyone may benefit."Regan Heath" <regan netwin.co.nz> wrote in message news:opsn61vgpg23k2f5 nrage.netwin.co.nz...Ok. So how does one define/declare a function that returns a function?--[test27.d]-- typedef fn function() fn;The circular reference to fn is what causes the crash. I've fixed the compiler to now issue a diagnostic error for it.
Apr 06 2005
On Wed, 06 Apr 2005 17:00:38 +0100, Stewart Gordon <smjg_1998 yahoo.com> wrote:Regan Heath wrote:Good question.. no idea :) I found the bug when trying to help here.. http://www.digitalmars.com/drn-bin/wwwnews?digitalmars.D/20080 Perhaps ask Brian what he was trying to do with it. ReganOn Tue, 5 Apr 2005 15:42:56 -0700, Walter <newshound digitalmars.com> wrote:So you can do stuff like fn qwert; qwert = qwert(); You've got me wondering how this could be used in practice...."Regan Heath" <regan netwin.co.nz> wrote in message news:opsn61vgpg23k2f5 nrage.netwin.co.nz...Ok. So how does one define/declare a function that returns a function?--[test27.d]-- typedef fn function() fn;The circular reference to fn is what causes the crash. I've fixed the compiler to now issue a diagnostic error for it.
Apr 06 2005









=?ISO-8859-15?Q?Thomas_K=FChne?= 