Skip to content

Commit

Permalink
more awesome error message when using a dangling variable in a model
Browse files Browse the repository at this point in the history
  • Loading branch information
moritz committed Jul 31, 2010
1 parent ad7e648 commit 0706fa1
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/Math/Model.pm
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ method topo-sort(*@vars) {
sub topo(*@a) {
for @a {
next if %!inv.exists($_) || %seen{$_} || $_ eq 'time';
die "Undeclared variable '$_' used in model"
unless %.variables.exists($_);
topo(param-names(%.variables{$_}));
@order.push: $_;
%seen{$_}++;
Expand Down

0 comments on commit 0706fa1

Please sign in to comment.