Skip to content

add -transition=checkimports switch#5476

Merged
MartinNowak merged 1 commit intodlang:masterfrom
WalterBright:checkimports
Feb 29, 2016
Merged

add -transition=checkimports switch#5476
MartinNowak merged 1 commit intodlang:masterfrom
WalterBright:checkimports

Conversation

@WalterBright
Copy link
Member

This is added to provide deprecation warnings to ease the transition to the new import lookup method introduced by #5445

@WalterBright WalterBright force-pushed the checkimports branch 2 times, most recently from 1f5a7be to eb6bf6c Compare February 25, 2016 05:09
@MartinNowak MartinNowak merged commit 0cdcda2 into dlang:master Feb 29, 2016
MartinNowak added a commit that referenced this pull request Feb 29, 2016
add -transition=checkimports switch
@MartinNowak
Copy link
Member

I also added this to the changelog, see 3cadde0.
Just out of curiosity, why this change of mind?

@MartinNowak
Copy link
Member

Also can we please move on w/ the other import/lookup/module fixes?
#5472
#5485

@9rnsr
Copy link
Contributor

9rnsr commented Mar 19, 2016

I have a question about the -checkimports switch.

dmd test.d

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

dmd -transition=import test.d

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

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

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

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.

@9rnsr
Copy link
Contributor

9rnsr commented Mar 19, 2016

I found another confusing behavior.

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 lik being working as exected.

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.

{
// Search both ways

auto sold = searchScopes(flags | SearchCheck10378);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, I noticed that we cannot get intentional result on this line.

When -transition=checkimports is specified, global.params.bug10378 is set to false, so this Dsymbol.search will return the new lookup algorithm result always.

@9rnsr
Copy link
Contributor

9rnsr commented Mar 19, 2016

@ibuclaw
Copy link
Member

ibuclaw commented Mar 19, 2016

Why not make this part of the deprecation command-line switch?

@9rnsr
Copy link
Contributor

9rnsr commented Mar 19, 2016

Because Walter didn't agree with introducing (little?) compilation speed slowdown to show informative deprecation messages...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants