Inlay hint on infered type with large string has incorrect details on LiteralString (original) (raw)
Summary
Interesting thing I found while messing around. If inside a collection like list/dict that gets inferred, and one of the values is a string with length > 4096 (2**12) the resulting inlay hint will say LiteralString but will have the data of str instead.
https://play.ty.dev/9d206cd5-2223-48cb-90e2-45e618dc6818
PS ~>echo $('x = ["' + "a" * 4097 + '"]' + "`nreveal_type(x)") > issue.py
PS ~>uvx ty check issue.py
info[revealed-type]: Revealed type
--> issue.py:2:13
|
1 | x = ["aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa…
2 | reveal_type(x)
| ^ `list[Unknown | str]`
|
