On 2020-01-25 16:58, ToddAndMargo via perl6-users wrote:
Hi All,
Anyone have a workaround to my stolen uint's?
> constant DWORD := uint32;
(uint32)
> subset StrOrDword where Str | DWORD;
(StrOrDword)
> sub x( StrOrDword $item ) {
* say "$item is a " ~ $item.^name;
* }
&x
> x( "abc" );
abc is a Str
> x( 3 );
Constraint type check failed in binding to parameter '$item'; expected
StrOrDword but got Int (3)
in sub x at <unknown file> line 1
in block <unit> at <unknown file> line 1
> x( 3.UInt );
Constraint type check failed in binding to parameter '$item'; expected
StrOrDword but got Int (3)
in sub x at <unknown file> line 1
in block <unit> at <unknown file> line 1
Many thanks,
-T
> say DWORD.Range
0..4294967295
> my DWORD $c=0xFF44;say $c.DWORD.Range
No such method 'DWORD' for invocant of type 'Int'
in block <unit> at <unknown file> line 1
AAAAAHHHH!!!!!