Bug 12880 – [REG2.066a] Wrong IFTI for string.init argument

Status
RESOLVED
Resolution
FIXED
Severity
regression
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2014-06-08T20:02:00Z
Last change time
2014-06-09T04:32:04Z
Keywords
pull, rejects-valid
Assigned to
nobody
Creator
sludwig

Comments

Comment #0 by sludwig — 2014-06-08T20:02:37Z
The following code errors out on DMD master (works correctly on previous releases): --- void test(T)(in T value) { static assert(is(T == string)); } void main() { test(string.init); } --- DMD v2.066 DEBUG bug_dmd_templ.d(1): Error: static assert (is(const(immutable(char)[]) == string)) is false bug_dmd_templ.d(2): instantiated from here: test!(const(immutable(char)[])) The "const" should be dropped for the inferred template argument.
Comment #1 by k.hara.pg — 2014-06-08T23:56:34Z
Comment #2 by github-bugzilla — 2014-06-09T04:32:02Z
Commit pushed to master at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/eef3ed682d0f1848d6b4236abb5ff156b1e33b3b fix Issue 12880 - Wrong IFTI for string.init argument Consider matching between e->type->mod to tparam->mod in deduceExpType