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

LTA error message for attr typed as defined #6012

Open
p6rt opened this issue Jan 19, 2017 · 1 comment
Open

LTA error message for attr typed as defined #6012

p6rt opened this issue Jan 19, 2017 · 1 comment

Comments

@p6rt
Copy link

p6rt commented Jan 19, 2017

Migrated from rt.perl.org#130589 (status was 'new')

Searchable as RT130589$

@p6rt
Copy link
Author

p6rt commented Jan 19, 2017

From @jdv

I'm not sure if "is required" qualifies as an "initializer"
to someone but it doesn't in my mind. Also, it would be nice
if it was called an attribute instead of the more generic
term variable. See below.

[jdv@​new-host-2 ~]$ perl6 -e 'class A {has Any​:D $.a};A.new(​:a(1))'
===SORRY!=== Error while compiling -e
Variable definition of type Any​:D requires an initializer
at -e​:1
------> class A {has Any​:D $.a⏏};A.new(​:a(1))
  expecting any of​:
  constraint
[jdv@​new-host-2 ~]$ perl6 -e 'class A {has Any​:D $.a=2};A.new(​:a(1))'
[jdv@​new-host-2 ~]$ perl6 -e 'class A {has Any​:D $.a is
required};A.new(​:a(1))'
[jdv@​new-host-2 ~]$ perl6 -v
This is Rakudo version 2016.12-377-g7ddc5f7 built on MoarVM version
2016.12-113-gd1da1ba
implementing Perl 6.c.
[jdv@​new-host-2 ~]$

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

1 participant