Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Allow for :file/:line in DEPRECATED
This should make it easier to issue DEPRECATED messages at compile time
  • Loading branch information
lizmat committed May 19, 2015
1 parent a552010 commit 29a4089
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/core/Deprecations.pm
Expand Up @@ -67,7 +67,7 @@ class Deprecation {
method obsolete (|c) { Obsolete.new(|c) }
}

sub DEPRECATED ( $alternative, $from?, $removed?, :$up = 1, :$what ) {
sub DEPRECATED($alternative,$from?,$removed?,:$up = 1,:$what,:$file,:$line) {

# not deprecated yet
state $version = $*PERL.compiler.version;
Expand Down Expand Up @@ -104,7 +104,7 @@ sub DEPRECATED ( $alternative, $from?, $removed?, :$up = 1, :$what ) {
$dep = %DEPRECATIONS{$dep.WHICH} //= $dep;

# update callsite
$dep.callsites{$callsite.file.IO}{$callsite.line}++;
$dep.callsites{$file // $callsite.file.IO}{$line // $callsite.line}++;
}

END {
Expand Down

0 comments on commit 29a4089

Please sign in to comment.