Subject: | Backwards test in Treex::PML::Node::validate_subtree() |
Date: | Tue, 3 Nov 2015 21:43:26 +0100 |
To: | <bug-Treex-PML [...] rt.cpan.org> |
From: | Alexis Dimitriadis <a.dimitriadis [...] uu.nl> |
Dear PML maintainers,
In Node.pm, the following code is broken:
sub Treex::PML::Node::validate_subtree {
my ($node, $log) = @_;
if (defined $log and UNIVERSAL::isa($log,'ARRAY')) {
croak __PACKAGE__."::validate: log must be an ARRAY reference";
}
< etc. >
The check is wrong: the second test should be negated, i.e., "and !
UNIVERSAL::isa($log, 'ARRAY')". The way it is right now, passing an
array reference in the optional argument results in an error.
Best,
Alexis