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

=> should need to be explicitly imported to be extended #43379

Closed
LilithHafner opened this issue Dec 9, 2021 · 3 comments · Fixed by #49368
Closed

=> should need to be explicitly imported to be extended #43379

LilithHafner opened this issue Dec 9, 2021 · 3 comments · Fixed by #49368
Labels
bug Indicates an unexpected problem or unintended behavior duplicate Indicates similar issues or pull requests

Comments

@LilithHafner
Copy link
Member

julia> 1 => 2
1 => 2

julia> (a => b) = 1 => 2 # Failed attempt to unpack a pair
Error showing value of type UnionAll:
ERROR: 
SYSTEM (REPL): showing an error caused an error
ERROR: 
SYSTEM (REPL): caught exception of type StackOverflowError while trying to handle a nested exception; giving up

julia> ...inconsistent state leading to Julia crash...

Should behave like + and other builtins:

julia> 1 => 2
1 => 2

julia> (a => b) = 1 => 2 # Failed attempt to unpack a pair
ERROR: error in method definition: function Base.=> must be explicitly imported to be extended
Stacktrace:
 [1] top-level scope
   @ none:0
 [2] top-level scope
   @ REPL[2]:1

julia> ...all is well...
@LilithHafner
Copy link
Member Author

@knuesel
Copy link
Member

knuesel commented Dec 9, 2021

=> and + do get the same treatment, the "must be explicitely imported" error occurs only if the Base function was used previously in the Julia session.

(Edit: I misread the error, they only get the same treatment if the Base version wasn't used previously, otherwise there is indeed a bug with =>)

@KristofferC
Copy link
Member

Dup of #25744

@LilithHafner LilithHafner added bug Indicates an unexpected problem or unintended behavior duplicate Indicates similar issues or pull requests labels Apr 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Indicates an unexpected problem or unintended behavior duplicate Indicates similar issues or pull requests
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants