Thread overview | |||||||
---|---|---|---|---|---|---|---|
|
June 22, 2014 mixin(__MODULE__) fails if module name is "module" | ||||
---|---|---|---|---|
| ||||
E.g.:
module.d: (or just `module module;` in source file)
```
import std.stdio;
void main() {
foreach (m; __traits(allMembers, mixin(__MODULE__))) { // module.d-mixin-4(4): Error: expression expected, not 'module'
writeln(m);
}
}
```
Documentation says:
> Package names cannot be keywords, hence the corresponding directory names cannot be keywords, either.
Shouldn't keywords be disallowed for module names?
|
June 22, 2014 Re: mixin(__MODULE__) fails if module name is "module" | ||||
---|---|---|---|---|
| ||||
Posted in reply to sigod | sigod:
> Shouldn't keywords be disallowed for module names?
I agree. (Walter seems not too keen on strictness). This question seems more fit for the main D newsgroup. Look in Bugzilla if there is a enhancement request.
Bye,
bearophile
|
June 22, 2014 Re: mixin(__MODULE__) fails if module name is "module" | ||||
---|---|---|---|---|
| ||||
Posted in reply to sigod | On Sunday, 22 June 2014 at 12:52:11 UTC, sigod wrote:
> module.d: (or just `module module;` in source file)
I was wrong about `module module;` declaration.
|
June 22, 2014 Re: mixin(__MODULE__) fails if module name is "module" | ||||
---|---|---|---|---|
| ||||
Posted in reply to bearophile | > This question seems more fit for the main D newsgroup. Should I create new thread in the main newsgroup? > Look in Bugzilla if there is a enhancement request. Yeah. I found one: https://issues.dlang.org/show_bug.cgi?id=456 |
June 24, 2014 Re: mixin(__MODULE__) fails if module name is "module" | ||||
---|---|---|---|---|
| ||||
Posted in reply to sigod | I opened new issue: https://issues.dlang.org/show_bug.cgi?id=12986 |
Copyright © 1999-2021 by the D Language Foundation