Bug 11245 – [REG 2.063] Can't access length of static arrays from within classes

Status
RESOLVED
Resolution
FIXED
Severity
regression
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2013-10-13T10:05:00Z
Last change time
2013-10-18T13:24:25Z
Keywords
pull, rejects-valid
Assigned to
nobody
Creator
code

Attachments

IDFilenameSummaryContent-TypeSize
1262repro.drepro casetext/x-dsrc161

Comments

Comment #0 by code — 2013-10-13T10:05:38Z
Created attachment 1262 repro case Its no longer possible to access the length of static arrays stored inside other types from within methods of classes. See attached repro case.
Comment #1 by rswhite4 — 2013-10-13T11:40:29Z
IMO this is correct, because f is not static and belongs to a struct instance. Or did I miss something?
Comment #2 by code — 2013-10-13T11:46:54Z
The length of f is known at compile time. There is no need for a this pointer to access it. Also it works if you put the same code into a regular function. It stops working inside methods. Additionaly this is a regression. It used to work in dmd 2.060.
Comment #3 by bugzilla — 2013-10-14T15:17:52Z
The repro case: ----------------------- struct Vec2 { float f[2]; } class Bar { void func() { float[Vec2.f.length] newVal; } } void main(string[] args) { (new Bar).func(); }
Comment #4 by k.hara.pg — 2013-10-18T09:25:15Z
Comment #5 by github-bugzilla — 2013-10-18T13:23:14Z
Commits pushed to master at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/9ed249a167eaac3ccf37c02a88cddbc27d02b683 fix Issue 11245 - Can't access length of static arrays from within classes https://github.com/D-Programming-Language/dmd/commit/87664d93149f24cc70a253742f4c25ece9ab472f Merge pull request #2679 from 9rnsr/fix11245 [REG2.063] Issue 11245 - Can't access length of static arrays from within classes
Comment #6 by github-bugzilla — 2013-10-18T13:24:09Z
Commit pushed to 2.064 at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/a913ce4bc59a94a022a27e390fc841f4aededffb Merge pull request #2679 from 9rnsr/fix11245 [REG2.063] Issue 11245 - Can't access length of static arrays from within classes