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
---