Bug 13030 – DMD assertion fails at mtype.c:697 if delegate has an argument name
Status
RESOLVED
Resolution
FIXED
Severity
regression
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2014-07-03T09:43:00Z
Last change time
2014-08-22T08:04:38Z
Keywords
ice, pull
Assigned to
nobody
Creator
liran
Comments
Comment #0 by liran — 2014-07-03T09:43:13Z
The following code:
void va(Args...)(const Args args) {}
void func(int delegate(int n) a)
{
va(a);
}
causes an assertion in dmd:
dmd: mtype.c:697: void Type::fixTo(Type*): Assertion `mod != t->mod' failed.
If the name of the delegate argument is removed [no 'n'] it compiles.
If the called function has just a single template [void mva(T)(const T args)] it compiles.
If the called functions receives non const args [void mva(A...)(A args)] it also compiles.
This is the minimal set of lines that I was able to get to in order to recreate the assertion error.
DMD64 D Compiler v2.065, fails on Linux and Mac OSX.(Did not try on other platforms)