www.digitalmars.com         C & C++   DMDScript  

D.gnu - [Bug 157] New: "Unexpected FunExp type" error on function literals

reply d-bugmail puremagic.com writes:
http://d.puremagic.com/bugzilla/show_bug.cgi?id=157

           Summary: "Unexpected FunExp type" error on function literals
           Product: GDC
           Version: 0.18
          Platform: All
        OS/Version: All
            Status: NEW
          Keywords: rejects-valid
          Severity: normal
          Priority: P2
         Component: glue layer
        AssignedTo: dvdfrdmn users.sf.net
        ReportedBy: dvdfrdmn users.sf.net


The following code fails with the error message:

int function(int)[1] table;

void main() {
    table[0] = function int(int x) { return x + 99; };
    assert(table[0](1) == 100);
}


-- 
May 27 2006
next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/bugzilla/show_bug.cgi?id=157


dvdfrdmn users.sf.net changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |ASSIGNED




-- 
May 27 2006
prev sibling next sibling parent reply d-bugmail puremagic.com writes:
http://d.puremagic.com/bugzilla/show_bug.cgi?id=157






Created an attachment (id=11)
 --> (http://d.puremagic.com/bugzilla/attachment.cgi?id=11&action=view)
Patch

Patch for missed case FuncExp::toElem


-- 
May 27 2006
parent reply Peri Hankey <mpah thegreen.co.uk> writes:
d-bugmail puremagic.com wrote:
 http://d.puremagic.com/bugzilla/show_bug.cgi?id=157
 
 
 
 
 

 Created an attachment (id=11)
  --> (http://d.puremagic.com/bugzilla/attachment.cgi?id=11&action=view)
 Patch
 
 Patch for missed case FuncExp::toElem
 
 
Quick, or what? Many thanks. But The patched file doesn't compile. I think line 14 of the patch should read: + return irs->nop(irs->addressOf(fd), type->toCtype()); instead of + return nop(irs->addressOf(fd), type->toCtype()); But that's mainly on the basis of superficial comparison with similar-looking bits of the code. Will report results. -- Peri Hankey mpah thegreen.co.uk http://languagemachine.sourceforge.net - The language machine
May 27 2006
parent Peri Hankey <mpah thegreen.co.uk> writes:
Peri Hankey wrote:
 d-bugmail puremagic.com wrote:
 
 http://d.puremagic.com/bugzilla/show_bug.cgi?id=157






 Created an attachment (id=11)
  --> (http://d.puremagic.com/bugzilla/attachment.cgi?id=11&action=view)
 Patch

 Patch for missed case FuncExp::toElem
Quick, or what? Many thanks. But The patched file doesn't compile. I think line 14 of the patch should read: + return irs->nop(irs->addressOf(fd), type->toCtype()); instead of + return nop(irs->addressOf(fd), type->toCtype()); But that's mainly on the basis of superficial comparison with similar-looking bits of the code. Will report results.
Results as promised (Mandrake/iva linux 10.x on x86): * build and install RPMS for gdc-0.18/gcc-4.0.2 * build languagemachine from source tarball using gdc-0.18/gcc-4.0.2 * looks ok: calculator examples * looks ok: metalanguage bootstrap * looks ok: java-to-D translator (minimal test) * looks ok: standard tests of languagemachine Thanks for your help. Peri -- Peri Hankey mpah thegreen.co.uk http://languagemachine.sourceforge.net - The language machine
May 27 2006
prev sibling next sibling parent Thomas Kuehne <thomas-dloop kuehne.cn> writes:
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

d-bugmail puremagic.com schrieb am 2006-05-27:
            Summary: "Unexpected FunExp type" error on function literals
 The following code fails with the error message:

 int function(int)[1] table;

 void main() {
     table[0] = function int(int x) { return x + 99; };
     assert(table[0](1) == 100);
 }
Added to DStress as http://dstress.kuehne.cn/run/f/function_06_A.d http://dstress.kuehne.cn/run/f/function_06_B.d Thomas -----BEGIN PGP SIGNATURE----- iD8DBQFEebYV3w+/yD4P9tIRAuO8AJ9bxIRBKfhZr2Q26IaGbDo9A96ORwCfYsi0 QsSIm4WgGYFfrLLYDArxtjU= =agKO -----END PGP SIGNATURE-----
May 28 2006
prev sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/bugzilla/show_bug.cgi?id=157


dvdfrdmn users.sf.net changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|                            |FIXED




-- 
Jun 03 2006