D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 7939 - Assigning to Object strips away const
Summary: Assigning to Object strips away const
Status: RESOLVED DUPLICATE of issue 3731
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: All All
: P2 normal
Assignee: No Owner
URL:
Keywords: accepts-invalid
Depends on:
Blocks:
 
Reported: 2012-04-18 17:40 UTC by Jonathan M Davis
Modified: 2015-06-09 05:14 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 Jonathan M Davis 2012-04-18 17:40:20 UTC
This code compiles:

class C
{
}

void main()
{
    const c = new C;
    Object o = c;
}

Clearly, it shouldn't, as it strips away const.
Comment 1 Steven Schveighoffer 2012-04-19 04:52:10 UTC

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