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

Coercion type Str(Any) returned from .keyof is not the same object as Str(Any) #6659

Open
p6rt opened this issue Jan 8, 2018 · 1 comment
Labels
JVM Related to Rakudo-JVM

Comments

@p6rt
Copy link

p6rt commented Jan 8, 2018

Migrated from rt.perl.org#132694 (status was 'new')

Searchable as RT132694$

@p6rt
Copy link
Author

p6rt commented Jan 8, 2018

From @usev6

On the JVM backend the coercion type returned from .keyof for a
regular hash is not the same object as Str(Any)​:

$ ./perl6-j -e 'use nqp; say nqp​::eqaddr(Str(Any), {"a"=>1}.keyof)'
0

$ ./perl6-m -e 'use nqp; say nqp​::eqaddr(Str(Any), {"a"=>1}.keyof)'
1

That's why some tests in S09-typed-arrays/hashes.t and S32-hash/perl.t
have a new failure mode after fixing RT #​132673. The objects are
compared with infix​:<===> from Any.pm and that uses nqp​::eqaddr. [1]

$ ./perl6-j -Ilib -e 'use Test; is({"a" => 1}.keyof, Str(Any))'
not ok 1 -
# Failed test at -e line 1
# expected​: (Str(Any))
# got​: (Str(Any))

I'm opening this ticket in order to update the todo message of said
tests.

[1]
https://github.com/rakudo/rakudo/blob/14c2cdb314ee5bbda34354ef535d4909dcea845a/src/core/Any.pm#L488

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

No branches or pull requests

1 participant