# https://www.reddit.com/r/rakulang/comments/p1ph7f/comment/h8ktmek
use lib '.';
use Types::Strong;
say 42 + 99; # 141
say "42" + "99"; # Error-> String concatenation requires operator '~'
unit module Types::Strong;
constant errorAny = "Error-> '+' requires numeric operands";
constant errorStr = "Error-> String concatenation requires operator '~'";
our proto infix:<+> (|) is export {*}
multi infix:<+> ( Numeric \l, Numeric \r ) { &CORE::infix:<+>(l,r) }
multi infix:<+> ( Str, Str ) { die errorStr }
multi infix:<+> ( Any, Any ) { die errorAny }