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

Baggy.perl confused by type objects #5599

Open
p6rt opened this issue Aug 20, 2016 · 2 comments
Open

Baggy.perl confused by type objects #5599

p6rt opened this issue Aug 20, 2016 · 2 comments
Labels

Comments

@p6rt
Copy link

p6rt commented Aug 20, 2016

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

Searchable as RT129007$

@p6rt
Copy link
Author

p6rt commented Aug 20, 2016

From zefram@fysh.org

((Nil) => 2).Bag.perl
(Nil=>2).Bag
((Nil) => 2).Bag.perl.EVAL.perl
("Nil"=>2).Bag

.perl.EVAL doesn't round-trip a Bag where any of the keys in the bag
deparses as an identifier. This happens because it's rolling its own
Pair deparsing and runs into autoquoting. This is the same problem that
was seen with Pair.perl in [perl #​126890]. The reliable fix would be
for Baggy.perl to construct Pair objects and call .perl on them, so that
the logic to handle this only needs to be in one place (Pair.perl).

-zefram

@p6rt
Copy link
Author

p6rt commented Aug 20, 2016

From zefram@fysh.org

Additional​: it also gets confused by some Pair objects as keys​:

(("a b" => "c") => 2).Bag.perl
("a b" => "c"=>2).Bag
(("a b" => "c") => 2).Bag.perl.EVAL.perl
Type check failed in assignment; expected Int but got Pair (​:c(2))
  in block <unit> at EVAL_15 line 1
  in block <unit> at <unknown file> line 1

Invoking Pair.perl would fix this too.

-zefram

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

No branches or pull requests

1 participant