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
subset StrToInt of Str where +*; multi foo(Int(StrToInt) $f) { say $f };
foo("42");
Cannot invoke this object (REPR: Null; VMNull)
in whatevercode at <unknown file> line 1
On Tue, 20 Jun 2017 10:42:18 -0700, druoso wrote:
subset StrToInt of Str where +*; multi foo(Int(StrToInt) $f) { say $f };
foo("42");
Cannot invoke this object (REPR: Null; VMNull)
in whatevercode at <unknown file> line 1
Looks to be an optimizer bug:
zoffix@VirtualBox~$ perl6 -e 'm: subset StrToInt of Str where {dd .Numeric; .Numeric}; multi foo(Int(StrToInt) $f) { say $f }; foo("42");'
Use of uninitialized value of type Str in numeric context
in block at -e line 1
0
Use of uninitialized value of type Str in numeric context
in block at -e line 1
42
42
42
zoffix@VirtualBox~$ perl6 --optimize=off -e 'm: subset StrToInt of Str where {dd .Numeric; .Numeric}; multi foo(Int(StrToInt) $f) { say $f }; foo("42");'
42
42
42
zoffix@VirtualBox~$ perl6 -e 'm: subset StrToInt of Str where {dd .Numeric; .Numeric}; sub foo(Int(StrToInt) $f) { say $f }; foo("42");'
42
42
zoffix@VirtualBox~$
Migrated from rt.perl.org#131610 (status was 'open')
Searchable as RT131610$
The text was updated successfully, but these errors were encountered: