Bug 20164 – Importing deprecated module at function-local scope does not output diagnostic message

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2019-08-24T22:54:32Z
Last change time
2019-08-26T12:08:21Z
Keywords
pull
Assigned to
No Owner
Creator
Mathias LANG

Comments

Comment #0 by pro.mathias.lang — 2019-08-24T22:54:32Z
``` --- mod1.d module mod1; void main() { import mod2; } --- mod2.d deprecated module mod2; ``` This does not output any message. Move the import outside of the function and it correctly does output a message.
Comment #1 by dlang-bot — 2019-08-24T23:35:14Z
@FeepingCreature created dlang/dmd pull request #10346 "Fix issue 20164: print deprecation if a deprecated module is imported from a local function or a mixin." fixing this issue: - Fix issue 20164: print deprecation if a deprecated module is imported from a local function or a mixin. https://github.com/dlang/dmd/pull/10346
Comment #2 by dlang-bot — 2019-08-26T12:08:21Z
dlang/dmd pull request #10346 "Fix issue 20164: print deprecation if a deprecated module is imported from a local function or a mixin." was merged into master: - f202a72a3c37711100ed28da37eab1a1d9e4fe65 by FeepingCreature: Fix issues 20163 and 20164: print deprecation if a deprecated module is imported from a local function or a mixin. https://github.com/dlang/dmd/pull/10346