KotlinIsland / KotlinIsland/basedtyping

transformer: automatically add `assert_never` to `match` if there is no `_` case

Open
#131 0 comments 0 reactions 0 assignees View on GitHub
transformer
Dominant language
Python
Stars
12
Forks
2
PR merge metrics
No merged PRs in 30d

Description

```py
def f(data: int):
match data:
case int(): ...
```
becomes
```py

def f(data: int):
match data:
case int(): ...
case _:
assert_never(data)
```

Contributor guide

No contributing guide indexed for this repository

Research direction

Start from the Python transformation example in the issue and locate the transformer entry point and its existing tests. Confirm that a match without a wildcard case receives the shown assert_never branch, while the issue's expected output serves as the completion check.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
tooling
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.