Skip to content

Give a better error message for incorrectly typed default arguments #3588

Closed
@ddfisher

Description

@ddfisher

Currently, a type error in the default value for an argument results in a generic Incompatible types in assignment (expression has type "X", variable has type "Y") error. As @gvanrossum pointed out in #3248, this deserves a special error such as: Default for argument XXX is incompatible with its type (expression has type "X", argument has type "Y").

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions