Bug 13280 – `this.sizeof` rejected as static array length in some cases

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2014-08-11T07:18:00Z
Last change time
2017-07-19T17:38:51Z
Keywords
pull, rejects-valid
Assigned to
nobody
Creator
verylonglogin.reg

Comments

Comment #0 by verylonglogin.reg — 2014-08-11T07:18:49Z
This code should comple fine: --- struct S { alias U = ubyte; alias T1 = ubyte[this.sizeof]; // ok alias T2 = const U[this.sizeof]; // ok alias T3 = const ubyte[this.sizeof]; // error } --- main.d(6): Error: Integer constant expression expected instead of this.sizeof ---
Comment #1 by k.hara.pg — 2015-02-21T15:53:58Z
Comment #2 by github-bugzilla — 2015-02-21T16:55:29Z
Commits pushed to master at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/cfde17106f88f471ab8c3188fc58d63723682918 fix Issue 13280 - `this.sizeof` rejected as static array length in some cases https://github.com/D-Programming-Language/dmd/commit/e5fdbf0975fde0a0bfcfad0d2dc24fa2576f437e Merge pull request #4431 from 9rnsr/fix13280 Issue 13280 - `this.sizeof` rejected as static array length in some cases
Comment #3 by github-bugzilla — 2015-06-17T21:01:08Z
Comment #4 by github-bugzilla — 2017-07-19T17:38:51Z
Commits pushed to dmd-cxx at https://github.com/dlang/dmd https://github.com/dlang/dmd/commit/cfde17106f88f471ab8c3188fc58d63723682918 fix Issue 13280 - `this.sizeof` rejected as static array length in some cases https://github.com/dlang/dmd/commit/e5fdbf0975fde0a0bfcfad0d2dc24fa2576f437e Merge pull request #4431 from 9rnsr/fix13280