Commits

Toby Inkster committed f5a2e54

error message for silly params

Comments (0)

Files changed (1)

 	my $self   = pop;
 	my @facets = @_;
 	my $regexp = qr{^${\(join "|", map quotemeta, @facets)}$}ms;
-			
+	my $name   = "$self";
+	
 	my $inline_generator = sub
 	{
 		my %p = @_;
 		return sub {
 			local $T = $_[0]->parent;
 			my $var  = $_[1];
-			sprintf(
+			my $r    = sprintf(
 				'(%s)',
 				join(
 					' and ',
 					map($facets{$_}->(\%p, $var), @facets),
 				),
 			);
+			croak sprintf(
+				'Attempt to parameterize type "%s" with unrecognised parameter%s %s',
+				$name,
+				scalar(keys %p)==1 ? '' : 's',
+				join(", ", map(qq["$_"], sort keys %p)),
+			) if keys %p;
+			return $r;
 		};
 	};