[Issue 7965] Invalid outer function scope pointer in some cases
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Mon Jul 2 08:35:19 PDT 2012
http://d.puremagic.com/issues/show_bug.cgi?id=7965
--- Comment #6 from Kenji Hara <k.hara.pg at gmail.com> 2012-07-02 08:37:57 PDT ---
(In reply to comment #5)
> Reduced test-case:
> ---
> struct S
> {
> string str;
> uint unused1, unused2 = 0;
> }
>
> auto f(alias fun)()
> {
> struct Result
> {
> S s;
>
> this(S _s) { s = _s; }
>
> void g() { assert(fun(s.str) == "xa"); }
> }
>
> return Result(S("a"));
> }
>
> void main() {
> string s = "x";
> f!(a => s ~= a)().g();
> assert(s == "xa");
> }
> ---
Thanks for your work and good test case!
https://github.com/D-Programming-Language/dmd/pull/1034
--
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
More information about the Digitalmars-d-bugs
mailing list