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
Match using the wrong class #4786
Comments
From @MARTIMMFollowing code generates 'P6opaque: must compose before allocating'. package P { my P::Regex $r .= new(:n<777>); This error is generated because the matching test is somehow using the Marcel |
From @jnthnOn Wed Nov 25 02:47:48 2015, mt1957@gmail.com wrote:
It's because a regex, like /^ 666/, actually has the type Regex, and the compiler resolves symbols using normal lexical scoping rules by default, so your Regex class hides the one defined by the Perl 6 setting. While the ability to replace core types is of course a useful feature for language extensibility, it's more likely to lead to confusion as in this ticket, so I've now tweaked the compiler to resolve Regex/Block/Sub/Parameter/Signature and similar directly in the current setting. This means that extensibility is still possible, but now requires the writing of a custom setting, which seems a fair burden to place on language extenders for the sake of everyone else. This policy applies also to exception types under the X:: namespace. For everything else, the normal lexical scoping rules still apply. Tests in S02-types/resolved-in-setting.t. /jnthn |
The RT System itself - Status changed from 'new' to 'open' |
@jnthn - Status changed from 'open' to 'resolved' |
From 1parrota@gmail.com"This means that extensibility is still possible, but now requires the That seems like a very reasonable policy; make life as convenient as |
Migrated from rt.perl.org#126728 (status was 'resolved')
Searchable as RT126728$
The text was updated successfully, but these errors were encountered: