FAQ
# New Ticket Created by "Carl Mäsak"
# Please include the string: [perl #116230]
# in the subject line of all future correspondence about this issue.
# <URL: https://rt.perl.org:443/rt3/Ticket/Display.html?id=116230 >


<doy> r: role Foo { }; class Bar { has Foo $.foo; method baz { my $foo
= $!foo; my $replacement = Foo.new; say $replacement.defined; say
$foo.defined; $foo //= $replacement; say $foo.defined } }; Bar.new.baz
<p6eval> rakudo 930369: OUTPUT«True␤False␤False␤»
<doy> role type constraints seem to break things
* masak submits rakudobug
<masak> r: role Foo {}; my $x = Foo; $x //= Foo.new; say $x.defined
<p6eval> rakudo 930369: OUTPUT«False␤»
<masak> r: role Foo {}; say Foo.new.defined
<p6eval> rakudo 930369: OUTPUT«True␤»
<masak> yeah. definitely something wrong there.
<masak> r: role Foo {}; my $x = Foo; $x = $x // Foo.new; say $x.defined
<p6eval> rakudo 930369: OUTPUT«False␤»

It is my expectation that when something undefined occurs on the lhs
of the infix:<//> operator, the rhs should be the result.

Search Discussions

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupperl6-compiler @
categoriesperl
postedDec 28, '12 at 6:51p
activeDec 28, '12 at 6:51p
posts1
users1
websiteperl6.org

1 user in discussion

Carl Mäsak: 1 post

People

Translate

site design / logo © 2018 Grokbase