On Sun, 20 Sep 2015 09:17:21 -0700, [email protected] wrote:
> Presumably using a defined value (anything other than a type object)
> as a type constraint should be a semantic error.
It does throw a compile-time error for the `my` declaration now, however the
error message is not appropriate:
➜ constant T = 3; my T $a; say $a; $a = 3; say $a;
===SORRY!=== Error while compiling:
Variable definition of type Int (implicit : by pragma)
requires an initializer
------> constant T = 3; my T $a⏏; say $a; $a = 3; say $a;
expecting any of:
constraint
According to bisectable¹, this new behavior was introduced by a commit² by
FROGGS in Oct 2015.
That commit implemented Type:D and Type:U types, and the "implicit : by pragma"
part of the error message is actually meant to print something like "implicit
:D by pragma", except apparently it also catches the unrelated issue of this RT.
It should be made to print a more appropriate message in this case.
Marking this as an LTA ticket.
---
[1] https://gist.github.com/Whateverable/a6f61fac5114f64747a8a9d913e2f3d7
[2] https://github.com/rakudo/rakudo/commit/80a3d07