[Issue 19454] New: Name collisions with unnamed function parameters
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Fri Nov 30 18:38:37 UTC 2018
https://issues.dlang.org/show_bug.cgi?id=19454
Issue ID: 19454
Summary: Name collisions with unnamed function parameters
Product: D
Version: D2
Hardware: x86_64
OS: Linux
Status: NEW
Severity: enhancement
Priority: P1
Component: dmd
Assignee: nobody at puremagic.com
Reporter: dhasenan at gmail.com
Example:
---
void foo(int _param_1, int) {}
---
Result is a compile error:
Error: function `scratch.foo` parameter foo._param_1 is already defined
Double-underscore identifiers are reserved by the compiler, but other
identifiers are not. The fix is to change _param_[index] to __param_[index],
presumably. That won't change the name collision, but it will at least move it
to "here be dragons" territory instead of "this looks like it should work".
--
More information about the Digitalmars-d-bugs
mailing list