[Issue 15811] New: -transition=import and -transition=checkimport have oddly behaviors

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Fri Mar 18 23:48:59 PDT 2016


https://issues.dlang.org/show_bug.cgi?id=15811

          Issue ID: 15811
           Summary: -transition=import and -transition=checkimport have
                    oddly behaviors
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: blocker
          Priority: P1
         Component: dmd
          Assignee: nobody at puremagic.com
          Reporter: k.hara.pg at gmail.com

>From the dmd help message:

$ dmd -transition=?
DMD v2.070 DEBUG

Language changes listed by -transition=id:
  =all           list information on all language changes
  =checkimports  give deprecation messages about 10378 anomalies
  =complex,14488 list all usages of complex or imaginary types
  =field,3449    list all non-mutable fields which occupy an object instance
  =import,10378  revert to single phase name lookup
  =tls           list all variables going into thread local storage

When I tested the combination with -transition=import and
-transition=checkimport switches, I get some oddly behaviors.

1) dmd test.d

Use new lookup algorithm without any information messages.
It's intentional because Walter hates compilation slow down to show messaged
for old behavior.

2) dmd -transition=import test.d

Use old lookup algorithm without any information messages.
Not bad.

3) dmd -transition=import -transition=checkimports test.d

Use old lookup algorithm with informative deprecation messages.
not bad.

4) dmd -transition=checkimports test.d

Use OLD lookup algorithm with informative deprecation messages.
Why we cannot use the new algorithm with information? It's inconvenient for
code upgrade path.


The reason is that `-transison=checkimports` will silently enables the old
lookup algorithm. Honestly I couldn't gess it from the command line help
message.


And, the two switches are order-dependent.

5a) dmd -transition=import -transition=checkimports test.d

-transition=import is overwritten by -transition=checkimports.
Current -transition=checkimports silently chooses old lookup rule, so it's
looked like being working as expected.

5b) dmd -transition=checkimports -transition=import test.d

-transition=checkimports is overwritten by -transition=import.
The information messages is killed by -transition=import, so it's very
confusing.


I think this is a blocker issue for the next 2.071.0 major release.

--


More information about the Digitalmars-d-bugs mailing list