D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 6863 - Can upcast to Base from const(Derived)
Summary: Can upcast to Base from const(Derived)
Status: RESOLVED DUPLICATE of issue 3731
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: Other Windows
: P1 normal
Assignee: No Owner
URL:
Keywords: accepts-invalid
Depends on:
Blocks:
 
Reported: 2011-10-30 00:38 UTC by Haruki Shigemori
Modified: 2011-12-12 21:23 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description Haruki Shigemori 2011-10-30 00:38:10 UTC
// dmd 2.56

class Base {}

class Derived : Base {}

void main()
{
    Base x = new const(Derived); // accepts-invalid
}
Comment 1 Haruki Shigemori 2011-10-30 00:46:40 UTC
Fixed a summary typo.
Comment 2 yebblies 2011-12-12 21:23:28 UTC

*** This issue has been marked as a duplicate of issue 3731 ***