Commit 4a73f34
authored
[codex] Fix type literal substitution regressions (#456)
## Summary
- stop `type[T]` substitution from raising internal errors when
inference feeds back singleton literals or `None`
- keep generated-callable names readable by omitting a bogus `None.`
module prefix
- add both low-level and `@assert_passes()` regressions for the
taxonomy-shaped `type[T] | T` path
## Root Cause
Latest `main` made `SubclassValue.make()` strict again, which meant
generic specialization for patterns like `type[T] | T` could crash when
`T` was inferred from a singleton runtime value and then substituted
back into the `type[T]` branch. Taxonomy hits this through ADT-style
singleton tags.
Separately, some generated callables can have `__module__ = None`, and
`stringify_object()` was rendering that directly into messages.
## Impact
This removes the new taxonomy internal errors without bringing back the
broader callable-reset change in `checker.py`. Error messages for
generated callables also stay readable.
## Validation
- `UV_CACHE_DIR=/tmp/uv-cache uv run --python 3.14 --extra tests pytest`
- `UV_CACHE_DIR=/tmp/uv-cache uv run --python 3.14 python
tools/taxonomy_ci.py --local-path /Users/jelle/Dropbox/code/taxonomy
--install`
## Taxonomy Artifact
- regenerated raw errors:
`/Users/jelle/py/pycroscope/tmp/taxonomy/raw-errors-2026-04-03-minimal-main.txt`1 parent 023a98d commit 4a73f34
4 files changed
Lines changed: 67 additions & 12 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| 5 | + | |
5 | 6 | | |
6 | 7 | | |
7 | 8 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1859 | 1859 | | |
1860 | 1860 | | |
1861 | 1861 | | |
| 1862 | + | |
| 1863 | + | |
| 1864 | + | |
| 1865 | + | |
| 1866 | + | |
| 1867 | + | |
| 1868 | + | |
| 1869 | + | |
| 1870 | + | |
| 1871 | + | |
| 1872 | + | |
| 1873 | + | |
| 1874 | + | |
| 1875 | + | |
| 1876 | + | |
| 1877 | + | |
| 1878 | + | |
| 1879 | + | |
| 1880 | + | |
| 1881 | + | |
| 1882 | + | |
| 1883 | + | |
| 1884 | + | |
| 1885 | + | |
| 1886 | + | |
| 1887 | + | |
| 1888 | + | |
| 1889 | + | |
| 1890 | + | |
| 1891 | + | |
| 1892 | + | |
1862 | 1893 | | |
1863 | 1894 | | |
1864 | 1895 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
9 | | - | |
| 9 | + | |
10 | 10 | | |
11 | 11 | | |
12 | | - | |
13 | 12 | | |
14 | 13 | | |
15 | 14 | | |
| |||
341 | 340 | | |
342 | 341 | | |
343 | 342 | | |
344 | | - | |
345 | | - | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
346 | 357 | | |
347 | 358 | | |
348 | 359 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2810 | 2810 | | |
2811 | 2811 | | |
2812 | 2812 | | |
2813 | | - | |
| 2813 | + | |
| 2814 | + | |
| 2815 | + | |
2814 | 2816 | | |
2815 | 2817 | | |
2816 | 2818 | | |
2817 | 2819 | | |
2818 | 2820 | | |
2819 | 2821 | | |
| 2822 | + | |
| 2823 | + | |
| 2824 | + | |
| 2825 | + | |
| 2826 | + | |
| 2827 | + | |
2820 | 2828 | | |
2821 | 2829 | | |
2822 | | - | |
| 2830 | + | |
2823 | 2831 | | |
2824 | 2832 | | |
2825 | 2833 | | |
| |||
4646 | 4654 | | |
4647 | 4655 | | |
4648 | 4656 | | |
4649 | | - | |
4650 | | - | |
4651 | | - | |
4652 | | - | |
4653 | | - | |
4654 | | - | |
| 4657 | + | |
| 4658 | + | |
| 4659 | + | |
| 4660 | + | |
| 4661 | + | |
| 4662 | + | |
| 4663 | + | |
| 4664 | + | |
| 4665 | + | |
| 4666 | + | |
4655 | 4667 | | |
4656 | 4668 | | |
4657 | 4669 | | |
| |||
0 commit comments