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

LTA error message when a class does itself in Rakudo #1507

Closed
p6rt opened this issue Feb 15, 2010 · 6 comments
Closed

LTA error message when a class does itself in Rakudo #1507

p6rt opened this issue Feb 15, 2010 · 6 comments
Labels

Comments

@p6rt
Copy link

p6rt commented Feb 15, 2010

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

Searchable as RT72840$

@p6rt
Copy link
Author

p6rt commented Feb 15, 2010

From @masak

<masak> rakudo​: class Boo does Boo { };
<p6eval> rakudo 70667a​: OUTPUT«Method 'postcircumfix​:<[ ]>' not found
for invocant of class 'Boo' [...]
* masak submits rakuodbug
<masak> std​: class Boo does Boo { };
<p6eval> std 29734​: OUTPUT«ok 00​:01 105m␤»
<masak> that's sick :)

The error message is wrong at best. Probably should be some error
message, even though it parses. But not that one. :)

@p6rt
Copy link
Author

p6rt commented Apr 26, 2010

From @jnthn

On Mon Feb 15 02​:18​:10 2010, masak wrote​:

<masak> rakudo​: class Boo does Boo { };
<p6eval> rakudo 70667a​: OUTPUT«Method 'postcircumfix​:<[ ]>' not found
for invocant of class 'Boo' [...]
* masak submits rakuodbug
<masak> std​: class Boo does Boo { };
<p6eval> std 29734​: OUTPUT«ok 00​:01 105m␤»
<masak> that's sick :)

The error message is wrong at best. Probably should be some error
message, even though it parses. But not that one. :)

Now it's the rather better​:

class Boo does Boo { };
Typename Boo must be pre-declared to use it with does at line 1

Given to moritz++ for spectest.

Thanks,

Jonathan

@p6rt
Copy link
Author

p6rt commented Apr 26, 2010

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

@p6rt
Copy link
Author

p6rt commented May 30, 2010

From @moritz

Tested in t/spec/S14-roles/basic.t.

@p6rt
Copy link
Author

p6rt commented May 30, 2010

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

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

p6rt commented May 30, 2010

From @kyleha

This is an automatically generated mail to inform you that tests are now available in t/spec/S14-roles/basic.t

commit dbb6aa1b12a067ba8bb1a02b0e339975715862ac
Author​: moritz <moritz@​c213334d-75ef-0310-aa23-eaa082d1ae64>
Date​: Sun May 30 20​:15​:51 2010 +0000

  [t/spec] test for RT #​72840 and RT #​69170
 
  git-svn-id​: http://svn.pugscode.org/pugs@&#8203;31001 c213334d-75ef-0310-aa23-eaa082d1ae64

Inline Patch
diff --git a/t/spec/S14-roles/basic.t b/t/spec/S14-roles/basic.t
index 9d48c95..04a81f4 100644
--- a/t/spec/S14-roles/basic.t
+++ b/t/spec/S14-roles/basic.t
@@ -120,7 +120,21 @@ eval_dies_ok '0 but RT66178', '"but" with non-existent role dies';
     my $x = eval 'class BClass does AClass { }; 1';
     nok $x, 'class SomeClass does AnotherClass  dies';
     ok "$!" ~~ /AClass/, 'Error message mentions the offending non-role';
+}
 
+# RT #72840
+{
+    eval 'class Boo does Boo { };';
+    ok "$!" ~~ /Boo/, 'class does itself produces sensible error message';
+}
+
+# RT #69170
+{
+    role StrTest {
+        method s { self.Str }
+    };
+    ok StrTest.s ~~ /StrTest/,
+        'default role stringification contains role name';
 }
 
 done_testing;

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

No branches or pull requests

1 participant