Skip to content

Commit

Permalink
You cannot use attributes on type objects
Browse files Browse the repository at this point in the history
Maybe "new-from-daycount" should become a multi, that also takes
instance objects to create new objects from?  At least this fixes
a very clear execution error.
  • Loading branch information
lizmat committed Jun 17, 2019
1 parent b1fac3d commit 5bdeedc
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/core/Date.pm6
Expand Up @@ -90,7 +90,7 @@ my class Date does Dateish {
multi method new(Date: Instant $i, :&formatter, *%_ --> Date:D) {
self.new(DateTime.new($i),:&formatter,|%_)
}
method new-from-daycount($daycount,:&formatter = &!formatter --> Date:D) {
method new-from-daycount($daycount,:&formatter --> Date:D) {
self!ymd-from-daycount($daycount, my $year, my $month, my $day);
nqp::eqaddr(self.WHAT,Date)
?? nqp::create(self)!SET-SELF($year,$month,$day,&formatter,$daycount)
Expand Down

0 comments on commit 5bdeedc

Please sign in to comment.