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

tighter and export not working together #4798

Closed
p6rt opened this issue Nov 29, 2015 · 4 comments
Closed

tighter and export not working together #4798

p6rt opened this issue Nov 29, 2015 · 4 comments
Labels

Comments

@p6rt
Copy link

p6rt commented Nov 29, 2015

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

Searchable as RT126761$

@p6rt
Copy link
Author

p6rt commented Nov 29, 2015

From @jdv

#OK
[jdv@​wieldy ~]$ perl6 -e 'sub infix​:<o1> ($a, $b) is export { say 1 };
sub infix​:<o2> ($a, $b) is tighter(&infix​:<o1>) is export { say 2 }; 1
o1 1 o2 1; say &[o1].prec; say &[o2].prec;'
2
1
prec => t=
prec => t@​=
[jdv@​wieldy ~]$

#NOT OK
[jdv@​wieldy ~]$ perl6 -e 'module m { sub infix​:<o1> ($a, $b) is export
{ say 1 }; sub infix​:<o2> ($a, $b) is tighter(&infix​:<o1>) is export {
say 2 }; }; import m; 1 o1 1 o2 1; say &[o1].prec; say &[o2].prec;'
1
2
prec => t=
prec => t=
[jdv@​wieldy ~]$

@p6rt
Copy link
Author

p6rt commented Dec 5, 2015

From @TimToady

The add_categorical method was assuming it was adding a fresh definition of an operator, not one borrowed from a module, so it overrode the existing precedence with the defaults, which are wrong if the existing precedence doesn't happen to match the default.

Fixed with bb598968c68bff2163322aea040bd81ec6097ae4

Test in fae390f38efad9e51d2224951d7eb3d47fe9b889

1 similar comment
@p6rt
Copy link
Author

p6rt commented Dec 5, 2015

From @TimToady

The add_categorical method was assuming it was adding a fresh definition of an operator, not one borrowed from a module, so it overrode the existing precedence with the defaults, which are wrong if the existing precedence doesn't happen to match the default.

Fixed with bb598968c68bff2163322aea040bd81ec6097ae4

Test in fae390f38efad9e51d2224951d7eb3d47fe9b889

@p6rt
Copy link
Author

p6rt commented Dec 5, 2015

@TimToady - Status changed from 'new' to 'resolved'

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

No branches or pull requests

1 participant