Bug 10033 – Wrong example in chapter Vector Extensions

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
dlang.org
Product
D
Version
D2
Platform
All
OS
All
Creation time
2013-05-05T11:23:00Z
Last change time
2014-04-23T00:12:05Z
Keywords
pull
Assigned to
andrej.mitrovich
Creator
kai

Comments

Comment #0 by kai — 2013-05-05T11:23:50Z
In the Language Reference, chapter Vector Extensions, section Accessing Individual Vector Elements: The 3rd example cast(int[4])v[3] = 2; does not compile. You have to add parenthesis to compile: (cast(int[4])v)[3] = 2; (According to TDPL, [] has a higher precedence then cast(). The compile error is therefore correct.)
Comment #1 by andrej.mitrovich — 2014-04-22T23:10:32Z
Comment #2 by github-bugzilla — 2014-04-23T00:12:04Z
Commits pushed to master at https://github.com/D-Programming-Language/dlang.org https://github.com/D-Programming-Language/dlang.org/commit/51b3f45e6761beff84a1f22984fa5d937f52364b Fix Issue 10033 - Wrong example in chapter Vector Extensions. https://github.com/D-Programming-Language/dlang.org/commit/3835280663863727db132efc1313c718d08c5040 Merge pull request #556 from AndrejMitrovic/Fix10033 [Trivial] Issue 10033 - Wrong example in chapter Vector Extensions.