https://d.puremagic.com/issues/show_bug.cgi?id=12150
Summary: Regression (2.063): char[] implicitly converts to
string in .dup expression
Product: D
Version: D2
Platform: All
OS/Version: All
Status: NEW
Keywords: accepts-invalid
Severity: regression
Priority: P2
Component: DMD
AssignedTo: [email protected]
ReportedBy: [email protected]
--- Comment #0 from Andrej Mitrovic <[email protected]> 2014-02-13
02:10:17 PST ---
-----
int foo(string arg)
{
return foo(arg.dup); // calls itself, stack overflow!
}
void main()
{
foo("foo");
}
-----
Note that storing the .dup to a variable first avoids the accepts-invalid:
-----
int foo(string arg)
{
auto duped = arg.dup;
return foo(duped); // NG, caught at compile-time
}
void main()
{
foo("foo");
}
-----
--
Configure issuemail: https://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------