New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Negated type check dies with "Class P6protoobject already registered" #1318
Comments
From @moritz23:06 <@moritz_> rakudo: say ( -> $x { $x } !~~ Code) LTA, IMNSHO :-) |
From @masak<masak> rakudo: sub foo {}; &foo !~~ Sub |
From @kylehaThis is an automatically generated mail to inform you that tests are now available in t/spec/S03-operators/smartmatch.t commit 2843b387ac3dc7f896f1ab214b1cf4b5a2f2b235 [t/spec] Tests for RT #69762 Inline Patchdiff --git a/t/spec/S03-operators/smartmatch.t b/t/spec/S03-operators/smartmatch.t
index 5e83510..50b8f22 100644
--- a/t/spec/S03-operators/smartmatch.t
+++ b/t/spec/S03-operators/smartmatch.t
@@ -1,7 +1,5 @@
use v6;
-
use Test;
-
plan *;
=begin pod
@@ -431,5 +429,48 @@ ok NaN ~~ NaN, 'NaN ~~ NaN is True';
eval_lives_ok 'class A { method foo { return "" ~~ * } }; A.new.foo',
'smartmatch in a class lives (RT 62196)';
+# RT #69762
+{
+ ok sub {} ~~ Callable, '~~ Callable (true)';
+ nok 68762 ~~ Callable, '~~ Callable (false)';
+ ok 69762 !~~ Callable, '!~~ Callable (true)';
+ #?rakudo todo 'false: sub {} !~~ Callable'
+ nok sub {} !~~ Callable, '!~~ Callable (false)';
+
+ ok sub {} ~~ Routine, '~~ Routine (true)';
+ nok 68762 ~~ Routine, '~~ Routine (false)';
+ #?rakudo 2 skip 'RT 69762, Class P6protoobject already registered!'
+ ok 69762 !~~ Routine, '!~~ Routine (true)';
+ nok sub {} !~~ Routine, '!~~ Routine (false)';
+
+ ok sub {} ~~ Sub, '~~ Sub (true)';
+ nok 68762 ~~ Sub, '~~ Sub (false)';
+ #?rakudo 2 skip 'RT 69762, Class P6protoobject already registered!'
+ ok 69762 !~~ Sub, '!~~ Sub (true)';
+ nok sub {} !~~ Sub, '!~~ Sub (false)';
+
+ ok sub {} ~~ Block, '~~ Block (true)';
+ nok 68762 ~~ Block, '~~ Block (false)';
+ #?rakudo 2 skip 'RT 69762, Class P6protoobject already registered!'
+ ok 69762 !~~ Block, '!~~ Block (true)';
+ nok sub {} !~~ Block, '!~~ Block (false)';
+
+ ok sub {} ~~ Code, '~~ Code (true)';
+ nok 68762 ~~ Code, '~~ Code (false)';
+ #?rakudo 2 skip 'RT 69762, Class P6protoobject already registered!'
+ ok 69762 !~~ Code, '!~~ Code (true)';
+ nok sub {} !~~ Code, '!~~ Code (false)';
+
+ class RT68762 { method rt68762 {} };
+
+ ok &RT68762::rt68762 ~~ Method, '~~ Method (true)';
+ nok 68762 ~~ Method, '~~ Method (false)';
+ #?rakudo 2 skip 'RT 69762, Class P6protoobject already registered!'
+ ok 69762 !~~ Method, '!~~ Method (true)';
+ nok &RT68762::rt68762 !~~ Method, '!~~ Method (false)';
+
+}
+
done_testing();
+
# vim: ft=perl6 |
The RT System itself - Status changed from 'new' to 'open' |
From @moritzWorks now, tests pass. |
@moritz - Status changed from 'new' to 'resolved' |
Migrated from rt.perl.org#69364 (status was 'resolved')
Searchable as RT69364$
The text was updated successfully, but these errors were encountered: