Skip to content

test: document container inference bugs with Any bounds - #5046

Open
asukaminato0721 wants to merge 1 commit into
facebook:mainfrom
asukaminato0721:tests-only-pr-4877
Open

asukaminato0721 wants to merge 1 commit into
facebook:mainfrom
asukaminato0721:tests-only-pr-4877

Conversation

@asukaminato0721

@asukaminato0721 asukaminato0721 commented Sep 29, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Any-bounded type variables erase concrete container element types and over-narrow repeated appends. The tests retain the intended type assertions and explicitly expect the current incorrect diagnostics.

The testcase! regressions use bug = markers and comments documenting the correct behavior. These are passing tests of known bugs, following the repository test guidance.

The complete implementation and regression tests remain in PR #4877. Related issue: #3265.

Validation

Based on upstream main at ef6de648bce0dc6dcca0a21a9fbb7490f23ecce8.

  • cargo test -p pyrefly --lib -- test_iter_container_literal test_any_bounded_typevar_container_hints test_any_bounded_typevar_empty_list_repeated_append — passed.
  • python3 test.py --no-test --no-tensor-shapes --no-conformance --no-jsonschema --no-extension — passed.

@meta-codesync

meta-codesync Bot commented Sep 29, 2026

Copy link
Copy Markdown
Contributor

This pull request has been imported. If you are a Meta employee, you can view this in D122390321. (Because this pull request was imported automatically, there will not be any future comments.)

@github-actions

This comment has been minimized.

@rchen152 rchen152 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

It looks like some of the tests you updated are failing; could you take a look?

@rchen152

rchen152 commented Oct 1, 2026

Copy link
Copy Markdown
Contributor

The tests assert the intended behavior and deliberately fail on current main until the fix is applied.

Oh, I see - sorry for not reading properly!

The way to write deliberately failing tests is to make the test pass on main but add a bug= marker (https://github.com/facebook/pyrefly/blob/main/AGENTS.md#the-bug-marker-in-tests) and comments documenting that the test demonstrates a bug and what the correct behavior would be.

@asukaminato0721 asukaminato0721 changed the title test: preserve container inference through Any-bounded type variables test: document container inference bugs with Any bounds Oct 2, 2026
@github-actions github-actions Bot added size/s and removed size/s labels Oct 2, 2026
@github-actions

github-actions Bot commented Oct 2, 2026

Copy link
Copy Markdown

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

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants