Thread overview
[Bug 157] New: "Unexpected FunExp type" error on function literals
May 27, 2006
d-bugmail
May 27, 2006
d-bugmail
May 27, 2006
d-bugmail
May 27, 2006
Peri Hankey
May 27, 2006
Peri Hankey
May 28, 2006
Thomas Kuehne
Jun 03, 2006
d-bugmail
May 27, 2006
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
http://d.puremagic.com/bugzilla/show_bug.cgi?id=157


dvdfrdmn@users.sf.net changed:

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




-- 

May 27, 2006
http://d.puremagic.com/bugzilla/show_bug.cgi?id=157





------- Comment #1 from dvdfrdmn@users.sf.net  2006-05-27 07:56 -------
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
d-bugmail@puremagic.com wrote:
> http://d.puremagic.com/bugzilla/show_bug.cgi?id=157
> 
> 
> 
> 
> 
> ------- Comment #1 from dvdfrdmn@users.sf.net  2006-05-27 07:56 -------
> 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
Peri Hankey wrote:
> d-bugmail@puremagic.com wrote:
> 
>> http://d.puremagic.com/bugzilla/show_bug.cgi?id=157
>>
>>
>>
>>
>>
>> ------- Comment #1 from dvdfrdmn@users.sf.net  2006-05-27 07:56 -------
>> 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 28, 2006
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


June 03, 2006
http://d.puremagic.com/bugzilla/show_bug.cgi?id=157


dvdfrdmn@users.sf.net changed:

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




--