Skip to content

Add context information for infer_literal_expr_type#11754

Closed
97littleleaf11 wants to merge 1 commit into
python:masterfrom
97littleleaf11:add-ctx-for-infer-literal
Closed

Add context information for infer_literal_expr_type#11754
97littleleaf11 wants to merge 1 commit into
python:masterfrom
97littleleaf11:add-ctx-for-infer-literal

Conversation

@97littleleaf11
Copy link
Copy Markdown
Collaborator

Description

When debugging on other issues, I found the returned Type of infer_literal_expr_type doesn't carry the context information. The following error message would lose line number.

Comment thread mypy/checkexpr.py
the comments in Instance's constructor for more details.
"""
typ = self.named_type(fallback_name)
typ.set_line(context)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I think that we can write a test case for this, maybe even inside check-columns.test

@97littleleaf11
Copy link
Copy Markdown
Collaborator Author

old branch

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.

2 participants