Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion class.c
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ XS(injected_constructor)
while((he = hv_iternext(params)))
sv_catpvf(paramnames, ", %" SVf, SVfARG(HeSVKEY_force(he)));

croak("Unrecognised parameters for %" HvNAMEf_QUOTEDPREFIX " constructor: %" SVf,
croak("Unrecognized parameters for %" HvNAMEf_QUOTEDPREFIX " constructor: %" SVf,
HvNAMEfARG(stash), SVfARG(paramnames));
}

Expand Down
2 changes: 1 addition & 1 deletion pod/perldiag.pod
Original file line number Diff line number Diff line change
Expand Up @@ -7544,7 +7544,7 @@ The message attempts to include the name of the called subroutine. If
the subroutine has been aliased, the subroutine's original name will be
shown, regardless of what name the caller used.

=item Unrecognised parameters for "%s" constructor: %s
=item Unrecognized parameters for "%s" constructor: %s

(F) You called new on a class but supplied a parameter name that
didn't match a class field name.
Expand Down
6 changes: 3 additions & 3 deletions t/class/construct.t
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@ use builtin qw( blessed reftype );
is($obj+0, builtin::refaddr($obj), 'numified object');
like("$obj", qr/^Testcase1=OBJECT\(0x[[:xdigit:]]+\)$/, 'stringified object' );

ok(!eval { Testcase1->new(x => 123, y => 456); 1 }, 'Unrecognised parameter fails');
like($@, qr/^Unrecognised parameters for "Testcase1" constructor: y at /,
'Exception thrown by constructor for unrecogniser parameter');
ok(!eval { Testcase1->new(x => 123, y => 456); 1 }, 'Unrecognized parameter fails');
like($@, qr/^Unrecognized parameters for "Testcase1" constructor: y at /,
'Exception thrown by constructor for unrecognized parameter');
}

{
Expand Down
Loading