[Issue 11970] New: Self-assigned variable expression with no effect doesn't have compiler error
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Wed Jan 22 08:23:46 PST 2014
https://d.puremagic.com/issues/show_bug.cgi?id=11970
Summary: Self-assigned variable expression with no effect
doesn't have compiler error
Product: D
Version: unspecified
Platform: All
OS/Version: All
Status: NEW
Severity: normal
Priority: P2
Component: DMD
AssignedTo: nobody at puremagic.com
ReportedBy: ilya-stromberg-2009 at yandex.ru
--- Comment #0 from ilya-stromberg <ilya-stromberg-2009 at yandex.ru> 2014-01-22 08:23:44 PST ---
Reduced example:
void main()
{
int i;
i = i;
}
The code `i = i;` does nothing, but there are no compiler error.
This error in real life:
https://github.com/rejectedsoftware/vibe.d/issues/406
Note that we already have errors for no effect expression, for example for this
code: `int i; i;` - `Error: var has no effect in expression (i)`.
--
Configure issuemail: https://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
More information about the Digitalmars-d-bugs
mailing list