[Issue 18432] alias x = x where x is an imported symbol should result in an error
https://issues.dlang.org/show_bug.cgi?id=18432 RazvanNchanged: What|Removed |Added Status|NEW |RESOLVED Resolution|--- |FIXED --- Comment #8 from RazvanN --- Fixed. See: https://github.com/dlang/dmd/pull/7954 --
[Issue 18432] alias x = x where x is an imported symbol should result in an error
https://issues.dlang.org/show_bug.cgi?id=18432 --- Comment #7 from Mike Franklin--- Reduced test case --- moduleA.d module moduleA; template TestTemplate() { } --- moduleB.d module moduleB; import moduleA : TestTemplate; alias TestTemplate = TestTemplate; --- main.d import moduleB; alias TestTemplate = moduleB.TestTemplate; void main() { } compile with: dmd main.d moduleA.d moduleB.d --
[Issue 18432] alias x = x where x is an imported symbol should result in an error
https://issues.dlang.org/show_bug.cgi?id=18432 Mike Franklinchanged: What|Removed |Added CC||slavo5...@yahoo.com --- Comment #6 from Mike Franklin --- Something that might be contributing to the problem is the compiler currently allows selectively importing private aliases: --- moduleA.d module moduleA; private int i; private alias I = i; static this() { i = 10; } --- main.d import std.stdio; import moduleA : I; void main() { writeln(I); } That compiles and prints "10". The statement `import moduleA : I;` should fail because `I` is private. --
[Issue 18432] alias x = x where x is an imported symbol should result in an error
https://issues.dlang.org/show_bug.cgi?id=18432 Martin Nowakchanged: What|Removed |Added CC||c...@dawg.eu --- Comment #5 from Martin Nowak --- (In reply to Steven Schveighoffer from comment #2) > I'm not 100% sure on the first one, as it seems like if it works, it's > simply a no-op. Can you give a reason why having it succeed is bad? It's not a no-op but actually created some weird alias behind the scenes, sth. like writeln (declared alias) -> writeln (alias from selective import) -> std.stdio.writeln (real symbol), not too sure. But with Raszvan's recent protection fix for selective imports this started to ran into an infinite loop. --
[Issue 18432] alias x = x where x is an imported symbol should result in an error
https://issues.dlang.org/show_bug.cgi?id=18432 --- Comment #4 from RazvanN--- PR : https://github.com/dlang/dmd/pull/7930 --
[Issue 18432] alias x = x where x is an imported symbol should result in an error
https://issues.dlang.org/show_bug.cgi?id=18432 RazvanNchanged: What|Removed |Added CC||timothee.co...@gmail.com --- Comment #3 from RazvanN --- *** Issue 18480 has been marked as a duplicate of this issue. *** --
[Issue 18432] alias x = x where x is an imported symbol should result in an error
https://issues.dlang.org/show_bug.cgi?id=18432 Steven Schveighofferchanged: What|Removed |Added CC||schvei...@yahoo.com --- Comment #2 from Steven Schveighoffer --- (In reply to RazvanN from comment #1) > Actually, > > import std.stdio : writeln; > alias writeln = std.stdio.writeln; > > Does not compile successfully, it issues an error : "Undefined identifier > std.stdio.writeln". This one works (or rather fails) as expected. Importing using selective imports does not pull in the fully qualified name to the namespace. I'm not 100% sure on the first one, as it seems like if it works, it's simply a no-op. Can you give a reason why having it succeed is bad? --
[Issue 18432] alias x = x where x is an imported symbol should result in an error
https://issues.dlang.org/show_bug.cgi?id=18432 --- Comment #1 from RazvanN--- Actually, import std.stdio : writeln; alias writeln = std.stdio.writeln; Does not compile successfully, it issues an error : "Undefined identifier std.stdio.writeln". --