[Issue 14653] scoped!range in foreach crashes

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Wed Jun 17 06:58:39 PDT 2015


https://issues.dlang.org/show_bug.cgi?id=14653

--- Comment #7 from Ketmar Dark <ketmar at ketmar.no-ip.org> ---
that's `inferAggregate()` which pulls out aliased type from wrapper, rewriting
it from `wrapit()` to `wrapit().rng`, and semantic then rewrites it to
`(Wrapper __tmpfordtor3 = wrapit(); , __tmpfordtor3).rng`. it does this:

  if (ad->aliasthis)
  {
      if (!att && tab->checkAliasThisRec())
          att = tab;
      fes->aggr = new DotIdExp(fes->aggr->loc, fes->aggr,
ad->aliasthis->ident);
      continue;
  }

i.e. literally pulling away aliased struct with `DotIdExp` (and dtoring result
of `wrapit()` by the way, as it thinks that it's not required anymore.

seems that `inferAggregate()` must postpone dtor calling for such cases.

--


More information about the Digitalmars-d-bugs mailing list