Thread overview
[Issue 19305] In symbol lookup, with statement becomes stronger than an inner scope import statement
Nov 27, 2018
RazvanN
Nov 27, 2018
Stefan Koch
Nov 27, 2018
karita
Nov 27, 2018
karita
Dec 17, 2022
Iain Buclaw
November 27, 2018
https://issues.dlang.org/show_bug.cgi?id=19305

RazvanN <razvan.nitu1305@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |razvan.nitu1305@gmail.com
         Resolution|---                         |INVALID

--- Comment #1 from RazvanN <razvan.nitu1305@gmail.com> ---
I don't see what the problem is. master git HEAD compiles this successfully as it should. The with scope takes precedence over imports. The rules are clear. Maybe older versions had a bug in it which was solved.

Closing as invalid. Please reopen if I am missing something.

--
November 27, 2018
https://issues.dlang.org/show_bug.cgi?id=19305

Stefan Koch <uplink.coder@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |REOPENED
                 CC|                            |uplink.coder@gmail.com
         Resolution|INVALID                     |---
           Severity|regression                  |normal

--- Comment #2 from Stefan Koch <uplink.coder@gmail.com> ---
I think this example should cause an ambiguity error.

Or the spec should be amended to explicitly break this tie.

--
November 27, 2018
https://issues.dlang.org/show_bug.cgi?id=19305

--- Comment #3 from karita <shigekikarita@gmail.com> ---
Yes, the current spec defines both with statement and innermost scope are "first". It should be ambiguous.

--
November 27, 2018
https://issues.dlang.org/show_bug.cgi?id=19305

--- Comment #4 from karita <shigekikarita@gmail.com> ---
For more clear example, 2.083 runs this without any errors.

void main() {
    with (a) {
        {
            import b;
            assert(f == "a");
        }
    }
}

--
December 17, 2022
https://issues.dlang.org/show_bug.cgi?id=19305

Iain Buclaw <ibuclaw@gdcproject.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Priority|P1                          |P3

--
December 13
https://issues.dlang.org/show_bug.cgi?id=19305

--- Comment #5 from dlangBugzillaToGithub <robert.schadek@posteo.de> ---
THIS ISSUE HAS BEEN MOVED TO GITHUB

https://github.com/dlang/dmd/issues/17882

DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB

--