https://issues.dlang.org/show_bug.cgi?id=21807
Issue ID: 21807
Summary: Non-immutable data can be converted to immutable using
function call in ctor
Product: D
Version: D2
Hardware: All
OS: All
Status: NEW
Severity: critical
Priority: P1
Component: dmd
Assignee: [email protected]
Reporter: [email protected]
class Foo
{
this()
{
// char[12] pp; str = pp; // error
str = bb(); // no error ???
}
string str;
}
char[12] bb()
{
char[12] res;
return res;
}
Also why it doesn't produce
Error: escaping reference to stack allocated value returned by bb()
???
--