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

of' Type annotation [NYI] for constant` declarator #3339

Open
p6rt opened this issue Feb 21, 2014 · 2 comments
Open

of' Type annotation [NYI] for constant` declarator #3339

p6rt opened this issue Feb 21, 2014 · 2 comments

Comments

@p6rt
Copy link

p6rt commented Feb 21, 2014

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

Searchable as RT121296$

@p6rt
Copy link
Author

p6rt commented Feb 21, 2014

From @raiph

my Int constant foo = 1 # should work and does in rakudo
my constant foo of Int = 1 # should work and does not in rakudo


using #perl6 evalbot​:

r​: my Int constant foo = 1
rakudo-parrot 5fe2db, rakudo-jvm 5fe2db, rakudo-moar 5fe2db​: ( no output )

r​: my constant foo of Int = 1
rakudo-jvm 5fe2db​: OUTPUT«�[31m===�[0mSORRY!�[31m===�[0m Error while compiling /tmp/tmpfile␤Wrong number of arguments passed; expected 1..1, but got 1␤at /tmp/tmpfile​:1␤------> ␤»
..rakudo-moar 5fe2db​: OUTPUT«�[31m===�[0mSORRY!�[31m===�[0m Error while compiling /tmp/tmpfile␤Unexpected named parameter 'SYMBOL' passed␤at /tmp/tmpfile​:1␤------> ␤»
..rakudo-parrot 5fe2db​: OUTPUT«�[31m===�[0mSORRY!�[31m===�[0m Error while compiling /tmp/tmpfile␤too many named arguments​: 1 passed, 0 used␤at /tmp/tmpfile​:1␤------> ␤»

std​: my constant foo of Int = 1
std 09dda5b​: OUTPUT«ok 00​:01 122m␤»

@p6rt
Copy link
Author

p6rt commented Sep 21, 2014

From @raiph

On Fri Feb 21 13​:21​:11 2014, raiph wrote​:

my Int constant foo = 1 # should work and does in rakudo

Hmm. It only appears to work. It actually compiles without error but ignores the type constraint​:

my Str constant foo = 1 # shouldn't work but does

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