[ty] Do not assume that fields have a default value (#20914)

## Summary

fixes https://github.com/astral-sh/ty/issues/1366

## Test Plan

Added regression test
This commit is contained in:
David Peter 2025-10-16 12:49:24 +02:00 committed by GitHub
parent c9dfb51f49
commit 0cc663efcd
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 29 additions and 19 deletions

View file

@ -497,6 +497,8 @@ class A:
a: str = field(kw_only=False)
b: int = 0
reveal_type(A.__init__) # revealed: (self: A, a: str, *, b: int = Literal[0]) -> None
A("hi")
```