Skip to content

New analyser: Crash in attrs plugin on bad or deferred name #7098

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

Closed
ilevkivskyi opened this issue Jun 28, 2019 · 0 comments · Fixed by #7132
Closed

New analyser: Crash in attrs plugin on bad or deferred name #7098

ilevkivskyi opened this issue Jun 28, 2019 · 0 comments · Fixed by #7132
Labels
crash priority-0-high semantic-analyzer Problems that happen during semantic analysis topic-attrs topic-plugins The plugin API and ideas for new plugins

Comments

@ilevkivskyi
Copy link
Member

Both of these crash with the new analyser:

[case testTypeInAttrBad]
import attr

@attr.s
class C:
    total = attr.ib(type=Bad)

[builtins fixtures/bool.pyi]

and

[case testTypeInAttrBad2]
import attr

@attr.s
class C:
    total = attr.ib(default=func())

def func(): ...
[builtins fixtures/bool.pyi]

Both crash with an assertion error because plugin doesn't expect a placeholder in class symbol table. I didn't check dataclasses, but likely there is a similar issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
crash priority-0-high semantic-analyzer Problems that happen during semantic analysis topic-attrs topic-plugins The plugin API and ideas for new plugins
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant