Bug 13576 – One more array @nogc literal case

Status
RESOLVED
Resolution
DUPLICATE
Severity
enhancement
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
x86
OS
Windows
Creation time
2014-10-06T13:17:00Z
Last change time
2014-10-06T17:27:40Z
Keywords
rejects-valid
Assigned to
nobody
Creator
bearophile_hugs

Comments

Comment #0 by bearophile_hugs — 2014-10-06T13:17:39Z
I am not sure but perhaps this can be accepted: immutable int[] a; static this() @nogc { a = [1]; } void main() {} dmd 2.067alpha gives: temp.d(3,9): Error: array literal in @nogc function _staticCtor1 may cause GC allocation
Comment #1 by k.hara.pg — 2014-10-06T13:35:41Z
Please gather the cases in issue 13381.
Comment #2 by bearophile_hugs — 2014-10-06T17:27:40Z
Merged with Issue 13381 *** This issue has been marked as a duplicate of issue 13381 ***