Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

0x... as hexadecimal notation of an integer is not supported for IntRange #1

Closed
brickpool opened this issue Apr 28, 2021 · 4 comments
Closed

Comments

@brickpool
Copy link

brickpool commented Apr 28, 2021

The use of IntRange[0, 0xffff] generates the following error ...
0xffff is not a known type constraint at c:/Perl64/site/lib/MooX/Press.pm line 1969.

package Test
{
  use Zydeco;

  class WideChar
  {
    has WideChar ( type => Int, is => "rw" );

    method UnicodeChar(IntRange[0, 0xffff] $value?)
    {
      ...

Maybe this is the more correct place
https://github.com/tobyink/p5-type-tiny/issues
because IntRange is provided by Types::Common::Numeric

@tobyink
Copy link
Owner

tobyink commented May 4, 2021

What happens if you upgrade to Type::Parser 1.012002?

@brickpool
Copy link
Author

brickpool commented May 5, 2021

package Test
{
  use Zydeco;

  class WideChar
  {
    has WideChar ( type => Int, is => "rw" );

    method UnicodeChar(IntRange[0, 0xffff] $value?)
    {
      ...
    }

    method AsciiChar(IntRange[-0x80, 0xff] $value?)
    {
      ...

IntRange[0, 0xffff] works, but IntRange[-0x80, 0xff] fails with the following message

Illegal hexadecimal digit '-' ignored at c:/Perl64/site/lib/Type/Parser.pm line 125.

@tobyink
Copy link
Owner

tobyink commented May 9, 2021

Type::Tiny 1.12.3 should fix...
https://metacpan.org/release/TOBYINK/Type-Tiny-1.012003

@brickpool
Copy link
Author

Now IntRange[-0x80, 0xff] works as expected.
Thank you for the update and thank you for your great work in general !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants