https://d.puremagic.com/issues/show_bug.cgi?id=12346
Summary: Inheriting from a class with a private constructor
results in a runtime error
Product: D
Version: D2
Platform: All
OS/Version: All
Status: NEW
Severity: major
Priority: P2
Component: DMD
AssignedTo: [email protected]
ReportedBy: [email protected]
--- Comment #0 from Mike <[email protected]> 2014-03-11 04:25:25 PDT ---
/********** test.d ***************/
module test;
abstract class DoNotInstantiate
{
private this() {}
}
class TestClass : DoNotInstantiate
{
uint value;
}
/************ main.d **************/
void main()
{
test.TestClass x; // <--- This should result in a compile-time error
x.value = 10; // <--- Runtime error.
}
--
Configure issuemail: https://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------