Skip to content
Permalink
Browse files

only use attribute access for definite objects

  • Loading branch information...
timo committed Jun 17, 2019
1 parent 5bdeedc commit f05b1b08035df6f15ebff5cca9847088752d41b5
Showing with 10 additions and 1 deletion.
  1. +10 −1 src/core/Date.pm6
@@ -90,7 +90,16 @@ 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 --> Date:D) {
proto method new-from-daycount($) {*}
multi 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)
!! self.bless(
:$year,:$month,:$day,:&formatter,:$daycount
)!SET-DAYCOUNT
}
multi method new-from-daycount(Date:D: $daycount,:&formatter = &!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 f05b1b0

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