So the gist of it is that Any % 2 is 0 but Int % 2 is an error. Still
reproducible (2017.11, HEAD(5929887))

On 2014-02-03 05:44:28, masak wrote:
> <masak> r: subset Odd of Int where { $_ % 2 }; my Odd $o; say $o; say
> $o % 2
> <camelia> rakudo-parrot 4a74e7: OUTPUT«(Odd)␤Invocant requires an
> instance, but a type object was passed [...]
> <camelia> ..rakudo-jvm 4a74e7: OUTPUT«(Odd)␤Cannot look up attributes
> in a type object [...]
> <camelia> ..rakudo-moar 4a74e7: OUTPUT«(Odd)␤Invocant requires an
> instance, but a type object was passed [...]
> <masak> huh.
> <masak> r: my Int $i; say $i % 2
> <camelia> rakudo-moar 4a74e7: OUTPUT«Invocant requires an instance,
> but a type object was passed [...]
> <camelia> ..rakudo-parrot 4a74e7: OUTPUT«Invocant requires an
> instance, but a type object was passed [...]
> <camelia> ..rakudo-jvm 4a74e7: OUTPUT«Cannot look up attributes in a
> type object [...]
> <masak> I don't remember infix:<%> behaving like that.
> <masak> I expected it to warn, but assume that an undefined Int
> numifies to 0.
> <masak> r: my Int $i; try say $i % 2; say "alive"
> <camelia> rakudo-parrot 4a74e7, rakudo-jvm 4a74e7, rakudo-moar 4a74e7:
> OUTPUT«alive␤»
> <masak> n: my Int $i; try say $i % 2; say "alive"
> <camelia> niecza v24-109-g48a8de3: OUTPUT«0␤alive␤»
> <masak> I say Niecza has it right. any comments from anyone before I
> submit a rakudobug?
> <masak> r: my $x; say $x % 2
> <camelia> rakudo-parrot 4a74e7: OUTPUT«use of uninitialized value of
> type Any in numeric context [...] ␤0␤»
> <camelia> ..rakudo-jvm 4a74e7, rakudo-moar 4a74e7: OUTPUT«use of
> uninitialized value of type Any in numeric context␤0␤»
> <masak> that's what I expect from Int undefined values, too.
> * masak submits rakudobug

Reply via email to