Skip to content

Commit

Permalink
Give Instant + Instant a more helpful error message
Browse files Browse the repository at this point in the history
  • Loading branch information
lizmat committed Jan 4, 2019
1 parent e58e376 commit e48712a
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/core/Instant.pm6
Expand Up @@ -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)
}
Expand Down

0 comments on commit e48712a

Please sign in to comment.