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

Type checking inconsistency between .new and .clone #3243

Closed
p6rt opened this issue Oct 1, 2013 · 7 comments
Closed

Type checking inconsistency between .new and .clone #3243

p6rt opened this issue Oct 1, 2013 · 7 comments

Comments

@p6rt
Copy link

p6rt commented Oct 1, 2013

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

Searchable as RT120059$

@p6rt
Copy link
Author

p6rt commented Oct 1, 2013

From @japhb

09​:09 < japhb__> r​: class A { has Int @​.ints }; my A $one .= new(ints
=> [1, 2]); say $one.ints; my $two = $one.clone(ints => [3, 4, 5]);
say $two.ints;
09​:09 < camelia> rakudo 0808ac​: OUTPUT«1 2␤Type check failed in
assignment to '@​!ints'; expected 'Int' but got 'Array'␤ in method
REIFY at src/gen/CORE.setting​:8106␤ in method reify at
src/gen/CORE.setting​:7027␤ in method gimme at
src/gen/CORE.setting​:7441␤ in method sink at src/gen/CORE.setting…»

09​:10 < jnthn> japhb__​: Something's inconsistent there...

09​:11 < japhb__> Yeah. It feels like there's just something missing
in one code path, or the .clone code bitrotted a bit, or somesuch

09​:12 < jnthn> japhb__​: Please RT it if you didn't already

@p6rt
Copy link
Author

p6rt commented Jun 20, 2015

From @usev6

I added a test (fudged 'skip') to S12-attributes/instance.t with commit Raku/roast@dbf53cb4b1

AFAIU this inconsistency stems from using nqp​::decont on attributes given to .new (in src/core/Mu.pm), but not doing so on attributes given to .clone. I added a PR (rakudo/rakudo#443) which would make the added test pass.

1 similar comment
@p6rt
Copy link
Author

p6rt commented Jun 20, 2015

From @usev6

I added a test (fudged 'skip') to S12-attributes/instance.t with commit Raku/roast@dbf53cb4b1

AFAIU this inconsistency stems from using nqp​::decont on attributes given to .new (in src/core/Mu.pm), but not doing so on attributes given to .clone. I added a PR (rakudo/rakudo#443) which would make the added test pass.

@p6rt
Copy link
Author

p6rt commented Jun 20, 2015

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

@p6rt
Copy link
Author

p6rt commented Jun 20, 2015

From @usev6

The test passes now. I'm closing this ticket as 'resolved'.

1 similar comment
@p6rt
Copy link
Author

p6rt commented Jun 20, 2015

From @usev6

The test passes now. I'm closing this ticket as 'resolved'.

@p6rt
Copy link
Author

p6rt commented Jun 20, 2015

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

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