You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
<masak> m: class D {}; my Array[D] %ds; %ds<bar>.push: D.new # golf'd
<camelia> rakudo-moar 17f023: OUTPUT«Type check failed in assignment
to '%ds'; expected 'Array[D]' but got 'Array' in method push [...]»
<masak> as far as I can understand, the above fails because the
auto-vivification helpfully creates an Array for me.
<masak> and that Array is not an Array[D], so the typecheck fails.
* masak submits rakudobug
<jnthn> m: class D {}; my Array[D] %ds; say %ds<bar>
<camelia> rakudo-moar 17f023: OUTPUT«(Array[D])»
<jnthn> Ah, good, so we do know the type...
<masak> m: class D {}; my Array[D] %ds; %ds<bar>.push: D.new # golf'd
<camelia> rakudo-moar 17f023: OUTPUT«Type check failed in assignment
to '%ds'; expected 'Array[D]' but got 'Array' in method push [...]»
<masak> as far as I can understand, the above fails because the
auto-vivification helpfully creates an Array for me.
<masak> and that Array is not an Array[D], so the typecheck fails.
* masak submits rakudobug
<jnthn> m: class D {}; my Array[D] %ds; say %ds<bar>
<camelia> rakudo-moar 17f023: OUTPUT«(Array[D])»
<jnthn> Ah, good, so we do know the type...
Migrated from rt.perl.org#122028 (status was 'resolved')
Searchable as RT122028$
The text was updated successfully, but these errors were encountered: