Right, because it's a Rat.

sub foo(num64 $scale = 1.0) {}; say foo # This type cannot unbox to a native
number: P6opaque, Rat
sub foo(num64 $scale = 1.0.Num) {}; say foo # Nil

I don't know what is the consensus on this one, but having to .Num your values
is rather reasonable.

The error message is LTA though.

On 2015-07-01 12:44:09, drf...@pobox.com wrote:
> num64 should be a floating-point type as per the docs, so $value = 1.0
> should be a reasonable floating-point default value for a function call.
> It's not an issue of being inappropriately downgraded to an int, because
> '$value = 1.1' returns the same error.
>
> --cut here--
> sub cvDivide( OpenCV2::Arr $arr,
> num64 $scale = 1.0, num64 $range = 0.0 )
> is native(LIB)
> cvDivide( OpenCV2::Arr.new );
> --cut here--
>
> throws this error instead:
>
> --cut here--
> prove -e'perl6 -Ilib'
> t/01-load.t ........ ===SORRY!===
> Default value '1' will never bind to a parameter of type num64
> at /home/jgoff/Repositories/perl6-OpenCV2/lib/OpenCV2/Arr.pm:412
> ------> num64 $scale = 1.0⏏,
>
> --cut here--

Reply via email to