Re: weirdness with subset on has

2020-01-13 Thread Joseph Brenner
Okay, I opened a github issue: https://github.com/rakudo/rakudo/issues/3421 On 1/13/20, Vadim Belman wrote: > At a quick glance, looks like a bug to me. Worth opening a ticket on > https://github.com/rakudo/rakudo > > Best regards, > Vadim Belman > >> On Jan 12, 2020, at 8:15 PM, Joseph Bren

Re: weirdness with subset on has

2020-01-13 Thread Vadim Belman
At a quick glance, looks like a bug to me. Worth opening a ticket on https://github.com/rakudo/rakudo Best regards, Vadim Belman > On Jan 12, 2020, at 8:15 PM, Joseph Brenner wrote: > > Moving the definition of the subset outside of the class > covers for the weird behavior... > > my @allowe

Re: weirdness with subset on has

2020-01-12 Thread Joseph Brenner
Moving the definition of the subset outside of the class covers for the weird behavior... my @allowed = << alpha beta gamma delta >>; my @default = << alpha >>; subset Allowed of Str where * eq any( @allowed ); class HasSubset { has Allowed @.grk = @default; method echo_grk {

weirdness with subset on has

2020-01-12 Thread Joseph Brenner
Here's a code snippet that tries to use a subset to constrain the values of an object field (i.e. declared with has). As written, this code works, but only when there's what looks like an irrelevant experimental line in it (labeled "WEIRD ONE"), when that line is commented out it throws an error..