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

Providing a list of attributes to a single 'has' leads to IMCC syntax errors #1630

Closed
p6rt opened this issue Mar 25, 2010 · 6 comments
Closed

Comments

@p6rt
Copy link

p6rt commented Mar 25, 2010

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

Searchable as RT73808$

@p6rt
Copy link
Author

p6rt commented Mar 25, 2010

From @moritz

./perl6 -e 'class A { has ($!a, $!b) }'
error​:imcc​:syntax error, unexpected ')' (')')
  in file 'EVAL_1' line 85

Not good...

(This is triggered by t/spec/S12-class/attributes.t, but not exercised
there - somehow the test harness doesn't catch those errors)

@p6rt
Copy link
Author

p6rt commented Aug 3, 2010

From @bbkr

$ perl6 -v

This is Rakudo Perl 6, version 2010.07-47-g9fd5eaa built on parrot 2.6.0

Copyright 2008-2010, The Perl Foundation

perl6 -e 'class A { has ($!a, $!b) }'
$ echo $?
0

taken for tests

@p6rt
Copy link
Author

p6rt commented Aug 3, 2010

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

@p6rt
Copy link
Author

p6rt commented Aug 3, 2010

From @bbkr

tests in t/spec/S12-class/attributes.t

@p6rt
Copy link
Author

p6rt commented Aug 3, 2010

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

@p6rt p6rt closed this as completed Aug 3, 2010
@p6rt
Copy link
Author

p6rt commented Aug 3, 2010

From @kyleha

This is an automatically generated mail to inform you that tests are now available in t/spec/S12-class/attributes.t

commit ba2c034ba3a2cc8f3ad6a53cc66328cb12dbe81e
Author​: bbkr <bbkr@​c213334d-75ef-0310-aa23-eaa082d1ae64>
Date​: Tue Aug 3 13​:23​:13 2010 +0000

  [t/spec] tests for RT #​73808 Providing a list of attributes to a single "has" leads to IMCC syntax errors
 
  git-svn-id​: http://svn.pugscode.org/pugs@&#8203;31895 c213334d-75ef-0310-aa23-eaa082d1ae64

Inline Patch
diff --git a/t/spec/S12-class/attributes.t b/t/spec/S12-class/attributes.t
index c4dc182..e513041 100644
--- a/t/spec/S12-class/attributes.t
+++ b/t/spec/S12-class/attributes.t
@@ -2,7 +2,7 @@ use v6;
 
 use Test;
 
-plan 19;
+plan 20;
 
 # L<S12/Methods/"For a call on your own private method">
 
@@ -92,4 +92,18 @@ is(@t[1], 200,             'array attribute initialized/works');
 $bar.bar[2] = 300;
 is($bar.bar[2], 300,       'array attribute initialized/works');
 
+# RT #73808
+{
+    class RT73808 {
+        has ($!a, $!b);
+        method foo {
+            $!a = 1;
+            $!b = 3;
+            return $!a + $!b;
+        }
+    }
+    is RT73808.new.foo, 4,
+        'Providing a list of attributes to a single "has" works';
+}
+
 # vim: ft=perl6

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant