Skip to content
Permalink
Browse files

Give Instant + Instant a more helpful error message

  • Loading branch information...
lizmat committed Jan 4, 2019
1 parent e58e376 commit e48712a30ac7454f9c4b45c2e0172ac3c4c0ad71
Showing with 3 additions and 0 deletions.
  1. +3 −0 src/core/Instant.pm6
@@ -88,6 +88,9 @@ multi sub infix:«>=»(Instant:D $a, Instant:D $b --> Bool:D) {
$a.tai >= $b.tai
}

multi sub infix:<+>(Instant:D $a, Instant:D $b) {
die "Adding two Instant values has no meaning, did you mean to subtract?"
}
multi sub infix:<+>(Instant:D $a, Real:D $b --> Instant:D) {
nqp::create(Instant).SET-SELF($a.tai + $b.Rat)
}

0 comments on commit e48712a

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