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
Stringify overload called too soon? #11705
Comments
From ben@morrow.me.ukCreated by ben@morrow.me.ukIf I have a class with both stringify and concat overloading, where package DeferConcat; use overload q/""/ => "force", q/./ => "concat"; sub new { bless [$_[1]] } then interpolating one of these objects into a string and assigning it my $o = DeferConcat->new("foo"); This may not seem surprising, but in every other case perl just calls my $x = "A $o B"; # assign with LVINTRO and indeed ref("A $o B") shows the bare expression is an object. If this is a bug, then it comes from this bit of op.c (l9826 in blead) case OP_CONCAT: where that 'break' causes the stringify not to get optimized away. I'm Ben Perl Info
|
Migrated from rt.perl.org#101640 (status was 'new')
Searchable as RT101640$
The text was updated successfully, but these errors were encountered: