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 should throw errors on unknown traits #443

Closed
p6rt opened this issue Dec 1, 2008 · 10 comments
Closed

Rakudo should throw errors on unknown traits #443

p6rt opened this issue Dec 1, 2008 · 10 comments

Comments

@p6rt
Copy link

p6rt commented Dec 1, 2008

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

Searchable as RT60966$

@p6rt
Copy link
Author

p6rt commented Dec 1, 2008

From ruslan.usifov@gmail.com

In this code, result will be 123, but i think that it must be 1.

sub test(@​test is copy)
{
  @​test[0] = 123;
};

my @​test = (1, 2, 3);
test(@​test);

print @​test[0];

@p6rt
Copy link
Author

p6rt commented Jan 11, 2009

@pmichaud - Status changed from 'new' to 'open'

@p6rt
Copy link
Author

p6rt commented Feb 13, 2009

From @jnthn

On Mon Dec 01 05​:13​:01 2008, tantra wrote​:

In this code, result will be 123, but i think that it must be 1.

sub test(@​test is copy)
{
@​test[0] = 123;
};

my @​test = (1, 2, 3);
test(@​test);

print @​test[0];

Indeed - fixed in git 6059ad9 and added tests to S06-traits/is-copy.t
(also fixed the "%test is copy" case and added tests for that).

Thanks!

Jonathan

@p6rt
Copy link
Author

p6rt commented Feb 13, 2009

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

@p6rt
Copy link
Author

p6rt commented Feb 18, 2009

ruslan.usifov@gmail.com - Status changed from 'resolved' to 'open'

@p6rt
Copy link
Author

p6rt commented Feb 18, 2009

From ruslan.usifov@gmail.com

On this code rakudo will hung

sub test($test is write)
{
  print $test
};

test(12);

And i think that is must be compiler error, with message Like this
"can't pass const as reference" or something else.

@p6rt
Copy link
Author

p6rt commented May 13, 2009

From @moritz

On Wed Feb 18 07​:42​:31 2009, tantra wrote​:

On this code rakudo will hung

sub test($test is write)
{
print $test
};

test(12);

And i think that is must be compiler error, with message Like this
"can't pass const as reference" or something else.

Actually it should complain about "write" not being a known trait.

Cheers,
Moritz

@p6rt
Copy link
Author

p6rt commented Jul 10, 2009

From @kyleha

This is an automatically generated mail to inform you that tests are now available in b/t/spec/S06-traits/misc.t

@p6rt
Copy link
Author

p6rt commented Sep 23, 2011

From @coke

On Wed May 13 14​:29​:52 2009, moritz wrote​:

On Wed Feb 18 07​:42​:31 2009, tantra wrote​:

On this code rakudo will hung

sub test($test is write)
{
print $test
};

test(12);

And i think that is must be compiler error, with message Like this
"can't pass const as reference" or something else.

Actually it should complain about "write" not being a known trait.

Cheers,
Moritz

Does this count as that?

$ ./perl6 foo
===SORRY!===
No applicable candidates found to dispatch to for 'trait_mod​:<is>'.
Available candidates are​:
:(Mu $type, Any $size, Any $nativesize)
:(Attribute $attr, Any $rw)
:(Attribute $attr, Any $readonly)
:(Routine $r, Any $rw)
:(Routine $r, Any $default)
:(Parameter $param, Any $readonly)
:(Parameter $param, Any $rw)
:(Parameter $param, Any $copy)
:(Routine $r, Any $export)
:(Mu $docee, Any $doc, Any $docs)
:(Mu $docee, Any $doc, Any $docs)
:(Routine $r, Any $hidden_from_backtrace)
:(Mu $child, Mu $parent)
:(Mu $type, Any $rw)

--
Will "Coke" Coleda

@p6rt
Copy link
Author

p6rt commented Sep 30, 2011

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

@p6rt p6rt closed this as completed Sep 30, 2011
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