Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Don't curry if there's nothing to curry
This fixes the LTA error on e.g. Hash[]:

 Too few positionals passed; expected at least 3 arguments but got only 2
  • Loading branch information
lizmat committed Mar 23, 2015
1 parent 9b5d4e2 commit a57affe
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/Perl6/World.nqp
Expand Up @@ -1971,9 +1971,12 @@ class Perl6::World is HLL::World {
# Curries a role with the specified arguments.
method parameterize_type_with_args($role, @pos_args, %named_args) {
# Make the curry right away and add it to the SC.
my $curried := $role.HOW.parameterize($role, |@pos_args, |%named_args);
self.add_object($curried);
return $curried;
if @pos_args || %named_args {
my $curried := $role.HOW.parameterize($role, |@pos_args, |%named_args);
self.add_object($curried);
return $curried;
}
$role;
}

# Creates a subset type meta-object/type object pair.
Expand Down

0 comments on commit a57affe

Please sign in to comment.