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)
Comment #1 by k.hara.pg — 2014-07-16T14:40:56Z
Comment #2 by github-bugzilla — 2014-07-17T07:55:03Z
Commits pushed to master at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/bb00087381377d7a24c3cf10e0afe0cdb7440eb1 fix Issue 13030 - DMD assertion fails at mtype.c:697 if delegate has an argument name https://github.com/D-Programming-Language/dmd/commit/e7be232da36d63560f75644da1bbb5532c359635 Merge pull request #3777 from 9rnsr/fix13030 [REG2.064] Issue 13030 - DMD assertion fails at mtype.c:697 if delegate has an argument name
Comment #3 by github-bugzilla — 2014-07-17T16:38:24Z
Commit pushed to 2.066 at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/0e0ac55a6e3b9fef99ecf242733fb20b34f10973 Merge pull request #3777 from 9rnsr/fix13030 [REG2.064] Issue 13030 - DMD assertion fails at mtype.c:697 if delegate has an argument name
Comment #4 by github-bugzilla — 2014-08-22T08:04:38Z