Bug 21832 – Wrong deprecation message when importing non-deprecated template in static condition

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2021-04-15T21:55:24Z
Last change time
2021-04-16T01:50:20Z
Keywords
pull
Assigned to
No Owner
Creator
Iain Buclaw

Comments

Comment #0 by ibuclaw — 2021-04-15T21:55:24Z
Similar to issue 21830, but uses selective imports. --- module mod; static if(1) { int fun()(int a) { return a; } } deprecated double fun()(double a) { return a; } --- module main; int inst(T)(T x) { import selective : fun; // template 'fun' is deprecated return fun(x); } int main() { return inst(0); // instantiated from here } ---
Comment #1 by ibuclaw — 2021-04-15T22:09:40Z
Correction on test: module mod; static if(1) { int fun()(int a) { return a; } } deprecated { double fun()(double a) { return a; } } --- module main; int inst(T)(T x) { import selective : fun; // template 'fun' is deprecated return fun(x); } int main() { return inst(0); // instantiated from here }
Comment #2 by dlang-bot — 2021-04-15T23:07:11Z
@ibuclaw created dlang/dmd pull request #12442 "fix Issue 21832 - Wrong deprecation message when importing non-deprecated template in static condition" fixing this issue: - fix Issue 21832 - Wrong deprecation message when importing non-deprecated template in static condition https://github.com/dlang/dmd/pull/12442
Comment #3 by dlang-bot — 2021-04-16T01:50:20Z
dlang/dmd pull request #12442 "fix Issue 21832 - Wrong deprecation message when importing non-deprecated template in static condition" was merged into master: - d029cc4c9fa06d96470c933da2d4c33614fa3c18 by Iain Buclaw: fix Issue 21832 - Wrong deprecation message when importing non-deprecated template in static condition https://github.com/dlang/dmd/pull/12442