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

“is default” trait is compile-time, but no warning is printed when I do stupid things (is default($x)) #5550

Open
p6rt opened this issue Aug 9, 2016 · 1 comment
Labels
LTA Less Than Awesome; typically an error message that could be better

Comments

@p6rt
Copy link

p6rt commented Aug 9, 2016

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

Searchable as RT128879$

@p6rt
Copy link
Author

p6rt commented Aug 9, 2016

From @AlexDaniel

Code​:
my $x = 42;
my @​a is default($x);
say @​a[1]

Result​:
(Any)

It is doc-ed correctly, so one might argue that the user should've known better. But it is very LTA, and if there is a way to warn the user (or why warn, let's make it a compile-time error?) then we should definitely do it.

@p6rt p6rt added the LTA Less Than Awesome; typically an error message that could be better label Jan 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
LTA Less Than Awesome; typically an error message that could be better
Projects
None yet
Development

No branches or pull requests

1 participant