Permalink
Browse files

more awesome error message when using a dangling variable in a model

  • Loading branch information...
1 parent ad7e648 commit 0706fa1b68e2544959a3d09fb6fe985934d47e5f @moritz committed Jul 31, 2010
Showing with 2 additions and 0 deletions.
  1. +2 −0 lib/Math/Model.pm
View
@@ -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{$_}++;

0 comments on commit 0706fa1

Please sign in to comment.