digitalmars.D.bugs - [Issue 2969] New: ICE on const declaration
- d-bugmail puremagic.com (46/46) May 12 2009 http://d.puremagic.com/issues/show_bug.cgi?id=2969
- d-bugmail puremagic.com (25/25) May 13 2009 http://d.puremagic.com/issues/show_bug.cgi?id=2969
- d-bugmail puremagic.com (10/10) May 13 2009 http://d.puremagic.com/issues/show_bug.cgi?id=2969
- d-bugmail puremagic.com (18/18) Aug 05 2009 http://d.puremagic.com/issues/show_bug.cgi?id=2969
- d-bugmail puremagic.com (12/12) Aug 31 2009 http://d.puremagic.com/issues/show_bug.cgi?id=2969
http://d.puremagic.com/issues/show_bug.cgi?id=2969
Summary: ICE on const declaration
Product: D
Version: 2.030
Platform: PC
OS/Version: Linux
Status: NEW
Severity: normal
Priority: P2
Component: DMD
AssignedTo: bugzilla digitalmars.com
ReportedBy: mikolalysenko gmail.com
Try compiling following snippet:
module sound;
import std.math;
struct Sound
{
float time;
float delegate(float) func;
this(float delegate(float) f, float t)
{
time = t;
func = f;
}
Sound opAdd(const(Sound) other)
{
return Sound(
(float t){
return func(t) + other.func(t);
}, fmax(time, other.time));
}
Sound opCat(const(Sound) other)
{
return Sound(
(float t){
if(t <= time)
return func(t);
return other.func(t - time);
}, time + other.time);
}
}
Gives the error message:
Internal error: ../ztc/cod4.c 353
--
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
May 12 2009
http://d.puremagic.com/issues/show_bug.cgi?id=2969
Gide Nwawudu <gide nwawudu.com> changed:
What |Removed |Added
----------------------------------------------------------------------------
Keywords| |ice-on-valid-code
CC| |gide nwawudu.com
Version|2.030 |2.029
OS/Version|Linux |All
Shorter version.
struct Sound {
int delegate(int) func;
this(int delegate(int) f) {
}
Sound opAdd(const(Sound) other)
{
return Sound(
(int t){
return other.func(0);
});
}
}
--
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
May 13 2009
http://d.puremagic.com/issues/show_bug.cgi?id=2969
Don <clugdbug yahoo.com.au> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |clugdbug yahoo.com.au
This _might_ be a duplicate of 2560 or 2875.
--
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
May 13 2009
http://d.puremagic.com/issues/show_bug.cgi?id=2969
Don <clugdbug yahoo.com.au> changed:
What |Removed |Added
----------------------------------------------------------------------------
Summary|ICE(cod4.c) on const |ICE(cod4.c) using const
|declaration |function parameter inside
| |delegate
Even shorter test case:
struct S {
int q;
}
void foo(const(S) x) {
int delegate(int t) bar = (int t){ return 1 + x.q; };
}
--
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Aug 05 2009
http://d.puremagic.com/issues/show_bug.cgi?id=2969
Don <clugdbug yahoo.com.au> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
Resolution| |DUPLICATE
This is another duplicate of 2560. Worked in 2.022.
*** This issue has been marked as a duplicate of issue 2560 ***
--
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Aug 31 2009









d-bugmail puremagic.com 