[Issue 14911] Compiler found indexing in code "new MyStruct[2].ptr"

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Thu Aug 13 03:17:29 PDT 2015


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

--- Comment #4 from Kenji Hara <k.hara.pg at gmail.com> ---
(In reply to kdmult from comment #3)
> (In reply to Sobirari Muhomori from comment #1)
> > Oh, did it work? AFAIK, D grammar never allowed to parse (new A.B) as (new
> > A).B, that would require semantic analysis before parsing.
> 
> http://dlang.org/changelog.html#postfix-new

Until 2.067, compiler parser had recognized `MyStruct[2].` for the new-ed type,
and `.ptr` was parsed as dot-identifier expression.

In 2.068, the issue 1215 fix had (accidentally) changed parser behavior, to
make the whole part of `MyStruct[2].ptr` as the new-ed type. Then semantic
analysis is failing to find such the type.

--


More information about the Digitalmars-d-bugs mailing list