D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 4630 - Primitive arguments to pure functions need not be converted to const
Summary: Primitive arguments to pure functions need not be converted to const
Status: RESOLVED DUPLICATE of issue 2832
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: Other Windows
: P2 normal
Assignee: No Owner
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-08-11 19:38 UTC by David Simcha
Modified: 2010-08-15 21:24 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 David Simcha 2010-08-11 19:38:54 UTC
void fun(uint x) pure {
    pragma(msg, typeof(x));  // const(uint)
}

Implicitly converting x to const is completely pointless, since it's just a stack variable with no indirection whatsoever.
Comment 1 bearophile_hugs 2010-08-12 04:21:51 UTC
See bug 2832
Comment 2 David Simcha 2010-08-15 21:24:26 UTC
Thanks, Bearophile.  It's definitely a duplicate.

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