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 constraint gets bad error message for bad default #4556

Closed
p6rt opened this issue Sep 19, 2015 · 5 comments
Closed

"of" type constraint gets bad error message for bad default #4556

p6rt opened this issue Sep 19, 2015 · 5 comments

Comments

@p6rt
Copy link

p6rt commented Sep 19, 2015

Migrated from rt.perl.org#126108 (status was 'resolved')

Searchable as RT126108$

@p6rt
Copy link
Author

p6rt commented Sep 19, 2015

From zefram@fysh.org

$ ./perl6 -e 'my $a of Int is default("foo")'
===SORRY!=== Error while compiling -e
Default value 'foo' will never bind to a parameter of type Any
at -e​:1
------> my $a of Int is default("foo")^<EOL>
  expecting any of​:
  constraint

The error message is correct that the specified default value doesn't
satisfy the type constraint, but it is incorrect in identifying the type.
The message looks nonsensical, because the value that it shows does
match the type that it states.

This fault doesn't occur if the type constraint is specified as "my
Int $a".

-zefram

@p6rt
Copy link
Author

p6rt commented Sep 1, 2016

From @zoffixznet

Appears to be fixed now.

Tests needed.

@p6rt
Copy link
Author

p6rt commented Sep 1, 2016

The RT System itself - Status changed from 'new' to 'open'

@p6rt
Copy link
Author

p6rt commented Sep 11, 2016

From @zoffixznet

Tests added in Raku/roast@9f65df7ada

@p6rt
Copy link
Author

p6rt commented Sep 11, 2016

@zoffixznet - Status changed from 'open' to 'resolved'

@p6rt p6rt closed this as completed Sep 11, 2016
@p6rt p6rt added the testneeded label Jan 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant