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
Enum value matching type name obliterates said name for that type. #5466
Comments
From @ShimmerFairy$ perl6 -e 'say Int.WHAT; enum A <B C Int>; say Int.WHAT' Note that the original type is still available under CORE: $ perl6 -e 'say Int.WHAT; enum A <B C Int>; say CORE::Int.WHAT' But this ruins more than just what name you can use: $ perl6 -e 'enum A <B C Int>; say 42' I found this bug when coming across this error: $ perl6 -e 'enum A <B Enumeration>; enum C <D E>;' The proper solution would be to not try to take that global in this case, and/or to allow the user to specify they don't want to pollute the global namespace in the first place. |
From @zoffixznetHi, Thanks for the report. That's really a language feature: being able to shadow core things. It works in many other places too: <Zoffix> m: say Str.WHAT; my \Str = 42; say Str.WHAT You also mentioned that it's a global effect, but it's actually lexical. Keeping in mind that shadowing core stuff is a feature not a bug, should this ticket be closed or do you think there's still an improvement to be made? If yes, what is it? -- |
The RT System itself - Status changed from 'new' to 'open' |
From @zoffixznetClosing per explanation above. |
@zoffixznet - Status changed from 'open' to 'rejected' |
Migrated from rt.perl.org#128667 (status was 'rejected')
Searchable as RT128667$
The text was updated successfully, but these errors were encountered: