Bug 6872 – Breaking type parsing of shared(inout(int)[])

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2011-11-01T04:59:00Z
Last change time
2011-12-11T11:16:06Z
Keywords
patch, rejects-valid
Assigned to
nobody
Creator
k.hara.pg

Comments

Comment #0 by k.hara.pg — 2011-11-01T04:59:19Z
Code: inout(int) func(shared(inout(int)[]) arr){ return 0; } Output: test.d(1): Error: inout on return means inout must be on a parameter as well for inout(int)(shared(shared(const(int))[]) arr) The shared(inout(int)[]) type is parsed as shared(shared(const(int))[]), it is incorrect.
Comment #1 by k.hara.pg — 2011-11-24T13:54:14Z
Comment #2 by k.hara.pg — 2011-12-11T03:38:49Z
Following cases are also rejected. static assert((shared(inout(const(int)[]))).stringof == "shared(inout(const(int)[]))"); static assert((shared(inout(const(int)[])[])).stringof == "shared(inout(const(int)[])[])"); static assert((shared(inout(const(immutable(int)[])[])[])).stringof == "shared(inout(const(immutable(int)[])[])[])"); The TypeNext::makeXXX() functions should convert the modifier of new next type object like Type::addMod() function. Updated patch and splitted pull request from #486. https://github.com/D-Programming-Language/dmd/pull/555
Comment #3 by bugzilla — 2011-12-11T11:16:06Z