2Tests the keyword-only feature of dataclass added in Python 3.10.
5# Specification: https://docs.python.org/3/library/dataclasses.html#module-contents
7from dataclasses import dataclass, KW_ONLY, field
22# This should generate an error because "b" is keyword-only.
[too-many-positional-arguments] Too many positional arguments: expected 1, got 2
28 b: int = field(kw_only=True, default=3)
37# This should generate an error because "b" is keyword-only.
[too-many-positional-arguments] Too many positional arguments: expected 1, got 2
41@dataclass(kw_only=True)
43 a: str = field(kw_only=False)
52# This should generate an error because "b" is keyword-only.
[too-many-positional-arguments] Too many positional arguments: expected 1, got 2