Skip to content

Conversation

@hyperkai
Copy link
Contributor

Fixes: #20549

@github-actions

This comment has been minimized.

Updated type alias test cases to reflect syntax changes.
@github-actions

This comment has been minimized.

Update error messages for invalid syntax in type alias tests.
@github-actions

This comment has been minimized.

Add tests for type alias unpacking with lists.
@github-actions

This comment has been minimized.

Update type alias tests to reflect unpacking errors for list[int].
@github-actions

This comment has been minimized.

Copy link
Member

@ilevkivskyi ilevkivskyi left a comment

Choose a reason for hiding this comment

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

Not a full review, just something for you while you are fixing the tests.

unpacked = get_proper_type(item.type)
if isinstance(unpacked, Instance):
assert unpacked.type.fullname == "builtins.tuple"
if unpacked.type.fullname != "builtins.tuple":
Copy link
Member

Choose a reason for hiding this comment

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

Please add a comment above this line explaining that expand_type() may be called during semantic analysis, before invalid unpacks are fixed.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

Updated test cases for TypeAlias unpacking in Python.
@github-actions
Copy link
Contributor

According to mypy_primer, this change doesn't affect type check results on a corpus of open source code. ✅

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.

Setting an unpacked list to the generic type alias gets the error message 'Please report a bug at ...'

2 participants