Skip to content

Commit

Permalink
- Constants defined inside classes are no longer defined as methods t…
Browse files Browse the repository at this point in the history
…o that class, but as static subroutines instead.
  • Loading branch information
trizen committed Oct 29, 2015
1 parent 27c78b5 commit 1ee0672
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/Sidef/Deparse/Perl.pm
Original file line number Diff line number Diff line change
Expand Up @@ -606,7 +606,7 @@ HEADER
$obj->{inited} = 1;

# Use dynamical constants inside functions
if (exists $self->{function}) {
if (exists $self->{function} or exists $self->{class}) {
$self->top_add("use experimental 'lexical_subs';\n");
$code = "state sub $name() { state \$_$refaddr"
. (defined($obj->{expr}) ? (" = " . $self->deparse_script($obj->{expr})) : '') . " }";
Expand Down

0 comments on commit 1ee0672

Please sign in to comment.