Bug 2533 – compiler falls with "assertion failed" message on wrong code
Status
RESOLVED
Resolution
FIXED
Severity
minor
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
x86
OS
Linux
Creation time
2008-12-21T11:52:00Z
Last change time
2015-06-09T01:20:51Z
Keywords
ice-on-invalid-code
Assigned to
bugzilla
Creator
resume755
Comments
Comment #0 by resume755 — 2008-12-21T11:52:18Z
When compiling this code with option -unittest compiler crashes with report:
dmd: mtype.c:5564: virtual Expression* TypeStruct::dotExp(Scope*, Expression*, Identifier*): Assertion `d' failed.
code:
template c()
{
alias typeof( this ) M;
M a( int op ) {
return this;
}
M b ( int op ) {
M res = this;
res.a( op );
return res;
}
}
struct S
{
mixin c;
mixin c;
}
unittest
{
alias S e;
}
Comment #1 by smjg — 2009-01-11T17:03:37Z
Doesn't crash for me, but produces (Windows):
----- 1.039 -----
bz2533.d(11): Error: bz2533.S.c!().a at bz2533.d(5) conflicts with bz2533.S.c!().a at bz2533.d(5)
bz2533.d(11): Error: bz2533.S.c!().a at bz2533.d(5) conflicts with bz2533.S.c!().a at bz2533.d(5)
----- 2.023 -----
bz2533.d(11): Error: overload set for res.a not allowed in struct declaration
bz2533.d(11): Error: function expected before (), not 0 of type int
bz2533.d(11): Error: overload set for res.a not allowed in struct declaration
bz2533.d(11): Error: function expected before (), not 0 of type int
----------
Can you still reproduce on Linux?
Comment #2 by resume755 — 2009-01-11T18:33:06Z
(In reply to comment #1)
> Doesn't crash for me, but produces (Windows):
>
> ----- 1.039 -----
> bz2533.d(11): Error: bz2533.S.c!().a at bz2533.d(5) conflicts with
> bz2533.S.c!().a at bz2533.d(5)
> bz2533.d(11): Error: bz2533.S.c!().a at bz2533.d(5) conflicts with
> bz2533.S.c!().a at bz2533.d(5)
> ----- 2.023 -----
> bz2533.d(11): Error: overload set for res.a not allowed in struct declaration
> bz2533.d(11): Error: function expected before (), not 0 of type int
> bz2533.d(11): Error: overload set for res.a not allowed in struct declaration
> bz2533.d(11): Error: function expected before (), not 0 of type int
> ----------
>
> Can you still reproduce on Linux?
>
Bug is fixed in dmd 2.023
http://www.digitalmars.com/d/2.0/changelog.html#new2_023