Bug 7682 – shared array type and "cast() is not an lvalue" error

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2012-03-11T04:31:00Z
Last change time
2012-03-11T20:42:40Z
Keywords
pull, rejects-valid
Assigned to
nobody
Creator
k.hara.pg

Comments

Comment #0 by k.hara.pg — 2012-03-11T04:31:40Z
Comment out of line A will suppress the error in line B. ---- template ConstOf(T) { alias const(T) ConstOf; } void main() { shared(ConstOf!(int[])) x; // line A struct S3 { int[10] a; } shared(S3) sh3; shared(int[]) sh3sub = sh3.a[]; assert(pointsTo(sh3sub)); // line B // Error: cast(shared(const(int[])))sh3sub is not an lvalue } bool pointsTo(S)(ref const S source) @trusted pure nothrow { return true; }
Comment #1 by k.hara.pg — 2012-03-11T04:42:34Z
Comment #2 by github-bugzilla — 2012-03-11T19:32:59Z
Commit pushed to master at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/0ac2cd091b51c158ecdad0c966e5ad910d2837c9 Merge pull request #797 from 9rnsr/fix7682 Issue 7682 - shared array type and "cast() is not an lvalue" error