Skip to content
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

Closed
p6rt opened this issue Sep 24, 2009 · 6 comments
Closed

Negated type check dies with "Class P6protoobject already registered" #1318

p6rt opened this issue Sep 24, 2009 · 6 comments
Labels
LHF Low-hanging fruit, easy to resolve

Comments

@p6rt
Copy link

p6rt commented Sep 24, 2009

Migrated from rt.perl.org#69364 (status was 'resolved')

Searchable as RT69364$

@p6rt
Copy link
Author

p6rt commented Sep 24, 2009

From @moritz

23​:06 <@​moritz_> rakudo​: say ( -> $x { $x } !~~ Code)
23​:06 <+p6eval> rakudo 0eaf62​: OUTPUT«Class P6protoobject already
  registered!␤in Main (/tmp/dggDmckmOR​:2)␤»

LTA, IMNSHO :-)

@p6rt
Copy link
Author

p6rt commented Oct 14, 2009

From @masak

<masak> rakudo​: sub foo {}; &foo !~~ Sub
<p6eval_> rakudo 3eceb8​: OUTPUT«Class P6protoobject already registered! [...]
* masak submits rakudobug
<masak> rakudo​: class A { method foo {} }; &A​::foo !~~ Method
<p6eval_> rakudo 3eceb8​: OUTPUT«Class P6protoobject already registered! [...]
<moritz_> rakudo​: say 2 !~~ Int
<p6eval_> rakudo 3eceb8​: OUTPUT«0␤»
<mathw> Weird
<masak> aye
<masak> rakudo​: say 2 !~~ Sub
<p6eval_> rakudo 3eceb8​: OUTPUT«Class P6protoobject already registered! [...]
<masak> it's the RHS that causes the trouble
<mathw> Does it do it with other code-y classes?
<masak> please check. :)
<moritz_> rakudo​: say 2 !~~ Block
<p6eval_> rakudo 3eceb8​: OUTPUT«Class P6protoobject already registered! [...]
<moritz_> rakudo​: say 2 !~~ Code
<p6eval_> rakudo 3eceb8​: OUTPUT«Class P6protoobject already registered! [...]
<moritz_> rakudo​: say 2 !~~ Routine
<p6eval_> rakudo 3eceb8​: OUTPUT«Class P6protoobject already registered! [...]
<mathw> Yes then
<moritz_> rakudo​: say 2 !~~ Callable
<p6eval_> rakudo 3eceb8​: OUTPUT«1␤»

@p6rt
Copy link
Author

p6rt commented Oct 21, 2009

From @kyleha

This is an automatically generated mail to inform you that tests are now available in t/spec/S03-operators/smartmatch.t

commit 2843b387ac3dc7f896f1ab214b1cf4b5a2f2b235
Author​: kyle <kyle@​c213334d-75ef-0310-aa23-eaa082d1ae64>
Date​: Wed Oct 21 18​:29​:20 2009 +0000

  [t/spec] Tests for RT #​69762
 
  git-svn-id​: http://svn.pugscode.org/pugs@&#8203;28875 c213334d-75ef-0310-aa23-eaa082d1ae64

Inline Patch
diff --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

@p6rt
Copy link
Author

p6rt commented Oct 21, 2009

The RT System itself - Status changed from 'new' to 'open'

@p6rt
Copy link
Author

p6rt commented Mar 30, 2010

From @moritz

Works now, tests pass.

@p6rt p6rt closed this as completed Mar 30, 2010
@p6rt
Copy link
Author

p6rt commented Mar 30, 2010

@moritz - Status changed from 'new' to 'resolved'

@p6rt p6rt added the LHF Low-hanging fruit, easy to resolve label Jan 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
LHF Low-hanging fruit, easy to resolve
Projects
None yet
Development

No branches or pull requests

1 participant