Skip to content

New semantic analyzer: fix redefining symbols as overloaded functions or classes - #6681

Merged
ilevkivskyi merged 2 commits into
python:masterfrom
ilevkivskyi:fix-newan-duplicate
Apr 17, 2019
Merged

ilevkivskyi merged 2 commits into
python:masterfrom
ilevkivskyi:fix-newan-duplicate

Conversation

@ilevkivskyi

Copy link
Copy Markdown
Member

Fixes #6432

This is a hot fix that simply extends the solution in PR #6429 to more situations. We agreed with @JukkaL that he will clean this up when he is back from PTO.

Note that we still give the errors for redefinitions that we consider invalid (see tests), but we don't crash now.

@ilevkivskyi
ilevkivskyi requested a review from msullivan April 16, 2019 14:36

@msullivan msullivan left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a cleaner solution planned?

@ilevkivskyi

Copy link
Copy Markdown
Member Author

Is there a cleaner solution planned?

The idea of name mangling looks like a hack, but it works OK so far (we also use this for --allow-redefinition). The problem is that all alternative cleaner solutions will be big changes. At least we will need to be sure that the name mangling works consistently and covers all corner cases. We can discuss this when we all will be in SF. There also few other topics highlighted by new analyzer work that might be worth discussing, e.g. tracking order of definitions, and SSA-like semantics for assignments.

@ilevkivskyi
ilevkivskyi merged commit 7f5866e into python:master Apr 17, 2019
@ilevkivskyi
ilevkivskyi deleted the fix-newan-duplicate branch April 17, 2019 00:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

New semantic analyzer: crash when function has multiple definitions

2 participants