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

Rakudo causes a Parrot assertion to fail when a parameterized role does a non-parameterized role #1193

Closed
p6rt opened this issue Aug 2, 2009 · 6 comments

Comments

@p6rt
Copy link

p6rt commented Aug 2, 2009

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

Searchable as RT68136$

@p6rt
Copy link
Author

p6rt commented Aug 2, 2009

From eternaleye@gmail.com

This code causes Parrot to fail in a rather spectacular manner​:

role TreeNode[​::T] does Positional {
  has TreeNode[T] @​!children handles 'postcircumfix​:<[ ]>';
  has T $.data is rw;
};
my $tree = TreeNode[Int].new;
$tree.data = 3;
$tree[0] = TreeNode[Int].new;
$tree[1] = TreeNode[Int].new;
$tree[0].data = 1;
$tree[1].data = 4;
.say for $tree.data, $tree[0,1]>>.data;

@p6rt
Copy link
Author

p6rt commented Mar 9, 2010

From @moritz

Current output​:

In "has" declaration, typename TreeNode must be predeclared (or marked
as declarative with :​: prefix) at line 2, near "[T] @​!chil"
current instr.​: 'perl6;HLL;Grammar;panic' pc 500 (ext

Which is also wrong, but less scary.

@p6rt
Copy link
Author

p6rt commented Mar 9, 2010

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

@p6rt
Copy link
Author

p6rt commented Sep 20, 2011

From @coke

On Sun Aug 02 13​:58​:12 2009, eternaleye@​gmail.com wrote​:

This code causes Parrot to fail in a rather spectacular manner​:

role TreeNode[​::T] does Positional {
has TreeNode[T] @​!children handles 'postcircumfix​:<[ ]>';
has T $.data is rw;
};
my $tree = TreeNode[Int].new;
$tree.data = 3;
$tree[0] = TreeNode[Int].new;
$tree[1] = TreeNode[Int].new;
$tree[0].data = 1;
$tree[1].data = 4;
.say for $tree.data, $tree[0,1]>>.data;

This now outputs​:
3
1
4

Needs tests.

--
Will "Coke" Coleda

@p6rt
Copy link
Author

p6rt commented Oct 16, 2011

From @moritz

Tested in t/spec/S14-roles/parameterized-type.t.

@p6rt
Copy link
Author

p6rt commented Oct 16, 2011

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

@p6rt p6rt closed this as completed Oct 16, 2011
@p6rt p6rt added the testneeded label Jan 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant