Basilisk fails union-of-members/enum equivalency in some case.
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 48/100
Research direction
Start with the linked Basilisk playground reproduction and the typing-spec enum-literal-expansion section. Trace the type-checker path for enum types versus complete unions of literal members; done means the sample no longer reports assignment_incompatibility and its assert_type expectation is accepted.
Written by the indexing model from the issue text.
Description
In typing spec at: #enum-literal-expansion.
Likewise, a type checker should treat a complete union of all literal members as equivalent to the enum type:
Code below reports assignment_incompatibility for x
class Answer(enum.Enum):
Yes = 1
No = 2
def test4(a: Answer) -> None:
x: Literal[Answer.Yes, Answer.No] = a
assert_type(a, Literal[Answer.Yes, Answer.No])
This was first reported against pyright but since this was a hole in the conformance suite as well and I opened an issue and PR about it here and discovered basilisk also failed in 1 case.
- Dominant language
- Rust
- Stars
- 54
- Forks
- 3
- PR merge metrics
- No merged PRs in 30d
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from Nimblesite/Basilisk
-
spec-violation
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Nimblesite/Basilisk#204 · 1 comment ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Nimblesite/Basilisk#188 ·
-
Difficulty 3/5 1-2 days Newbie friendliness 68/100
Nimblesite/Basilisk#439 ·
-
Generics Open
Difficulty 4/5 3-5 days Newbie friendliness 50/100
Nimblesite/Basilisk#419 · 1 comment ·
-
Difficulty 4/5 3-5 days Newbie friendliness 45/100
Nimblesite/Basilisk#418 ·
All issues in Nimblesite/Basilisk
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
kwakseongjae/auto-hwp#319 ·
-
area:cli bug filter-quality good first issue priority:medium
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
-
Difficulty 1/5 Under an hour Newbie friendliness 72/100
bevyengine/bevy#25861 ·
-
comp-datalake
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
ClickHouse/ClickHouse#121222 ·
-
enhancement remote
Difficulty 2/5 1-3 hours Newbie friendliness 68/100