Bug 4297 – Nothrow functions cannot use constant dynamic array

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2010-06-08T15:32:00Z
Last change time
2014-02-15T02:46:16Z
Keywords
rejects-valid
Assigned to
nobody
Creator
rsinfu
Depends on
3864, 4298

Comments

Comment #0 by rsinfu — 2010-06-08T15:32:21Z
DMD rejects nothrow functions which use compile-time constant dynamic array for violating nothrow. -------------------- immutable TABLE = [ 1, 2, 3 ]; pragma(msg, typeof(TABLE)); // immutable(int[]) void foo() nothrow // Error: function test.foo 'foo' is nothrow yet may throw { const(int)[] tab; tab = TABLE; } -------------------- The error does not occur if TABLE is declared with auto or immutable int[3] (instead of mere "immutable").
Comment #1 by clugdbug — 2010-11-03T06:35:59Z
Fixed svn 736.