ruff/crates/ty_python_semantic/resources/mdtest
Abhijeet Prasad Bodas 68b0386007
[ty] Implement DataClassInstance protocol for dataclasses. (#18018)
Fixes: https://github.com/astral-sh/ty/issues/92

## Summary

We currently get a `invalid-argument-type` error when using
`dataclass.fields` on a dataclass, because we do not synthesize the
`__dataclass_fields__` member.

This PR fixes this diagnostic.

Note that we do not yet model the `Field` type correctly. After that is
done, we can assign a more precise `tuple[Field, ...]` type to this new
member.

## Test Plan
New mdtest.

---------

Co-authored-by: David Peter <mail@david-peter.de>
2025-05-13 10:31:26 +02:00
..
annotations [ty] Understand homogeneous tuple annotations (#17998) 2025-05-12 22:02:25 -04:00
assignment [ty] Understand homogeneous tuple annotations (#17998) 2025-05-12 22:02:25 -04:00
binary [ty] Infer parameter specializations of generic aliases (#18021) 2025-05-12 22:12:44 -04:00
boolean
boundness_declaredness Update class literal display to use <class 'Foo'> style (#17889) 2025-05-06 20:11:25 -04:00
call [ty] Understand homogeneous tuple annotations (#17998) 2025-05-12 22:02:25 -04:00
class Update class literal display to use <class 'Foo'> style (#17889) 2025-05-06 20:11:25 -04:00
comparison
comprehensions
conditional
declaration
diagnostics [semantic-syntax-tests] IrrefutableCasePattern, SingleStarredAssignment, WriteToDebug, InvalidExpression (#17748) 2025-05-09 14:54:05 -04:00
directives
doc ty_python_semantic: add union type context to function call type errors 2025-05-09 13:40:51 -04:00
exception [ty] Understand homogeneous tuple annotations (#17998) 2025-05-12 22:02:25 -04:00
expression [ty] Understand classes that inherit from subscripted Protocol[] as generic (#17832) 2025-05-09 17:39:15 +01:00
function [ty] Understand homogeneous tuple annotations (#17998) 2025-05-12 22:02:25 -04:00
generics [ty] Infer parameter specializations of generic aliases (#18021) 2025-05-12 22:12:44 -04:00
import Fix typos (#17988) 2025-05-09 14:57:14 -04:00
literal [ty] Understand classes that inherit from subscripted Protocol[] as generic (#17832) 2025-05-09 17:39:15 +01:00
loops
narrow [ty] Narrowing for hasattr() (#18053) 2025-05-12 18:58:14 -04:00
regression
scopes [ty] Understand classes that inherit from subscripted Protocol[] as generic (#17832) 2025-05-09 17:39:15 +01:00
shadowing
snapshots [ty] Allow classes to inherit from type[Any] or type[Unknown] (#18060) 2025-05-12 20:30:21 -04:00
stubs Update class literal display to use <class 'Foo'> style (#17889) 2025-05-06 20:11:25 -04:00
subscript [ty] Understand homogeneous tuple annotations (#17998) 2025-05-12 22:02:25 -04:00
suppressions
type_of Update class literal display to use <class 'Foo'> style (#17889) 2025-05-06 20:11:25 -04:00
type_properties [ty] Understand homogeneous tuple annotations (#17998) 2025-05-12 22:02:25 -04:00
type_qualifiers
unary Update class literal display to use <class 'Foo'> style (#17889) 2025-05-06 20:11:25 -04:00
with
.mdformat.toml
attributes.md [ty] Understand homogeneous tuple annotations (#17998) 2025-05-12 22:02:25 -04:00
cycle.md [ty] add cycle handling for FunctionType::signature query (#17833) 2025-05-05 12:12:38 -07:00
dataclass_transform.md [ty] Detect overloads decorated with @dataclass_transform (#17835) 2025-05-07 15:51:13 +02:00
dataclasses.md [ty] Implement DataClassInstance protocol for dataclasses. (#18018) 2025-05-13 10:31:26 +02:00
decorators.md ty_python_semantic: add union type context to function call type errors 2025-05-09 13:40:51 -04:00
descriptor_protocol.md Update class literal display to use <class 'Foo'> style (#17889) 2025-05-06 20:11:25 -04:00
final.md
intersection_types.md
invalid_syntax.md
known_constants.md
mdtest_config.md
mdtest_custom_typeshed.md [ty] Fix duplicate diagnostics for unresolved module when an import from statement imports multiple members (#17886) 2025-05-06 12:37:10 +01:00
metaclass.md Update class literal display to use <class 'Foo'> style (#17889) 2025-05-06 20:11:25 -04:00
mro.md [ty] Allow classes to inherit from type[Any] or type[Unknown] (#18060) 2025-05-12 20:30:21 -04:00
named_tuple.md [ty] Add more tests for NamedTuples (#17975) 2025-05-10 10:46:08 +02:00
overloads.md
pep695_type_aliases.md [ty] Understand homogeneous tuple annotations (#17998) 2025-05-12 22:02:25 -04:00
properties.md ty_python_semantic: add union type context to function call type errors 2025-05-09 13:40:51 -04:00
protocols.md [ty] Understand classes that inherit from subscripted Protocol[] as generic (#17832) 2025-05-09 17:39:15 +01:00
slots.md
statically_known_branches.md Fix typos (#17988) 2025-05-09 14:57:14 -04:00
sys_platform.md
sys_version_info.md
terminal_statements.md
type_api.md Update class literal display to use <class 'Foo'> style (#17889) 2025-05-06 20:11:25 -04:00
typed_dict.md
union_types.md
unpacking.md
unreachable.md