Skip to content

Wrong inferred constructor arguments for inherited generic dataclass #10703

@sattlerc

Description

@sattlerc

Bug description

import dataclasses


@dataclasses.dataclass
class B[X]:
    x: X


@dataclasses.dataclass
class C(B[int]):
    pass


C(x=0)

Configuration

Command used

pylint a.py

Pylint output

************* Module a
a.py:14:0: E1123: Unexpected keyword argument 'x' in constructor call (unexpected-keyword-arg)

Expected behavior

No warnings

Pylint version

pylint 4.0.2
astroid 4.0.1
Python 3.13.7 (main, Aug 15 2025, 12:34:02) [GCC 15.2.1 20250813]

OS / Environment

No response

Additional dependencies

Metadata

Metadata

Assignees

No one assigned

    Labels

    Needs triage 📥Just created, needs acknowledgment, triage, and proper labelling

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions