On Mon, 09 Feb 2015 06:35:57 -0800, elizabeth wrote:
> [15:31:47]  <lizmat>    m: sub a(Int(Cool:D) $a) { say $a }; a Cool
> # feels this should fail
> [15:31:48]  <+camelia>  rakudo-moar d29715: OUTPUT«use of
> uninitialized value of type Cool in numeric context  in sub a at
> /tmp/L77KWsiM9N:1␤␤0␤»
> [15:32:03]  <lizmat>    or complain about the :D in the coercer
>  [15:32:16]  <lizmat>    std: sub a(Int(Cool:D) $a) { say $a }; a Cool
> [15:32:18]  <+camelia>  std f9b7f55: OUTPUT«ok 00:01 141m␤»
> [15:33:06]  <lizmat>    m: sub a(Cool:D $a as Int) { say $a }; a Cool
> # should fail like this
> [15:33:06]  <+camelia>  rakudo-moar d29715: OUTPUT«Parameter '$a'
> requires an instance, but a type object was passed␤  in sub a at
> /tmp/D5UepJwrRP:1␤  in block <unit> at /tmp/D5UepJwrRP:1␤␤»
> [15:33:30]  <timotimo>  sounds reasonable to me, maybe someone could
> rakudobug it
> [15:33:50]  <lizmat>    I will
> [15:34:12]  <jnthn>     lizmat: Yeah...which in turn really wants
> definedness types to become first class too...

Some cases of this work now, and the rest are covered by RT#126433.
Tests were rearranged to reflect this in roast commit 574035ff4,
so resolving this ticket and leaving RT#126433 for the outstanding issues.

Reply via email to