Bug 9182 – [REG2.059] Forward reference error with static immutable struct members

Status
NEW
Severity
normal
Priority
P3
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2012-12-18T18:36:44Z
Last change time
2024-12-13T18:03:29Z
Keywords
rejects-valid
Assigned to
No Owner
Creator
bearophile_hugs
Moved to GitHub: dmd#18508 →

Comments

Comment #0 by bearophile_hugs — 2012-12-18T18:36:44Z
struct Foo { static immutable F = Foo(); static immutable Foo[1] foos1 = [F]; static immutable foos3 = [F]; } void main() {} DMD 2.061alpha: Assertion failure: '0' on line 1235 in file 'glue.c'
Comment #1 by yebblies — 2013-01-14T02:35:29Z
With 2.062 head it doesn't ice. Now prints: testx.d(3): Error: forward reference of variable F or testx.d(4): Error: variable testx.Foo.foos3 had semantic errors when compiling If you move the lines around. I suspect this is a dupe of one of the other forward reference bugs.
Comment #2 by andrej.mitrovich — 2013-02-09T21:55:30Z
(In reply to comment #1) > With 2.062 head it doesn't ice. Current 2.062 head (b58ef83b22e4e4375e83aeb3f9e1ba18774f0688): Without -g: test.d(4): Error: variable test.Foo.foos3 had semantic errors when compiling With -g crash and: ty = 35, '_error_'
Comment #3 by dlang-bugzilla — 2017-06-25T17:18:07Z
Comment #4 by robert.schadek — 2024-12-13T18:03:29Z
THIS ISSUE HAS BEEN MOVED TO GITHUB https://github.com/dlang/dmd/issues/18508 DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB