Skip to content
Permalink
Browse files

You cannot use attributes on type objects

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 5bdeedcbe77e52e5ffc85a77faa9a4863cbf8172
Showing with 1 addition and 1 deletion.
  1. +1 −1 src/core/Date.pm6
@@ -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)

0 comments on commit 5bdeedc

Please sign in to comment.
You can’t perform that action at this time.