Bug 14846 – Insufficient context deduction with implicit nested lambda

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2015-07-29T04:46:00Z
Last change time
2017-07-22T12:36:18Z
Keywords
pull, rejects-valid
Assigned to
nobody
Creator
k.hara.pg

Comments

Comment #0 by k.hara.pg — 2015-07-29T04:46:27Z
Test case: void foo(Dg)(scope Dg code) { pragma(msg, Dg); // Now Dg is deduced to 'void function()', // but it should be 'void delegate()'. code(); } void main() { int x; struct S { this(int n) { x = n; } ~this() { x = 99; } } foo({ S s; }); foo({ S s = S(); }); foo({ S s = S(1); }); foo({ S[3] s; }); foo({ S* p = new S(); }); foo({ S* p = new S(1); }); foo({ S[] a = [S()]; }); foo({ S[] a = [S(1)]; }); }
Comment #1 by k.hara.pg — 2015-07-29T10:53:09Z
Comment #2 by github-bugzilla — 2015-07-29T22:51:23Z
Commits pushed to master at https://github.com/D-Programming-Language/phobos https://github.com/D-Programming-Language/phobos/commit/5cdf726149c588ce95e25bdaaee23f8a8949e48a Supplemental fix for issue 14846 `new Input!(Range, ErrorLevel)` should take the `input` parameter to initialize its field by that, because: if `Range` is a nested struct, its context pointer is not accessible from inside CsvReader. https://github.com/D-Programming-Language/phobos/commit/4abd9533761e3043438dc8e7c6dcbc0687800789 Merge pull request #3519 from 9rnsr/fix14846 Supplemental fix for issue 14846
Comment #3 by github-bugzilla — 2015-08-07T07:53:30Z
Commits pushed to master at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/35f348635b50842e9620c52db071f4d11af25199 fix Issue 14846 - Insufficient context deduction with implicit nested lambda https://github.com/D-Programming-Language/dmd/commit/9538fe5ea2a7e1d85e0b1a111790be31a52ebefe Merge pull request #4848 from 9rnsr/fix14846 Issue 14846 - Insufficient context deduction with implicit nested lambda
Comment #4 by github-bugzilla — 2015-10-04T18:20:08Z
Comment #5 by github-bugzilla — 2017-07-22T12:36:18Z
Commits pushed to dmd-cxx at https://github.com/dlang/dmd https://github.com/dlang/dmd/commit/35f348635b50842e9620c52db071f4d11af25199 fix Issue 14846 - Insufficient context deduction with implicit nested lambda https://github.com/dlang/dmd/commit/9538fe5ea2a7e1d85e0b1a111790be31a52ebefe Merge pull request #4848 from 9rnsr/fix14846