[Issue 4297] New: Nothrow functions cannot use constant dynamic array
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Tue Jun 8 15:32:23 PDT 2010
http://d.puremagic.com/issues/show_bug.cgi?id=4297
Summary: Nothrow functions cannot use constant dynamic array
Product: D
Version: 2.041
Platform: All
OS/Version: All
Status: NEW
Keywords: rejects-valid
Severity: normal
Priority: P2
Component: DMD
AssignedTo: nobody at puremagic.com
ReportedBy: rsinfu at gmail.com
--- Comment #0 from Shin Fujishiro <rsinfu at gmail.com> 2010-06-08 15:32:21 PDT ---
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").
--
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
More information about the Digitalmars-d-bugs
mailing list