Skip to content

[red-knot] remove TODO catch-all case in infer_unary_expression #14548

@carljm

Description

@carljm

Currently, the method TypeInferenceBuilder::infer_unary_expression handles some common cases, and has a catch-all arm that simply infers a "todo" type.

This issue is to remove that todo catch-all case, and replace it with correct handling of all missing cases.

For many of the unhandled types (e.g. Type::FunctionLiteral, Type::ClassLiteral, Type::SubclassOf) the correct handling will be to treat it as a Type::Instance type (an instance of types.FunctionType, or an instance of the meta-type of a class) and let the normal instance handling from typeshed take care of it.

(note: edited description for correctness, which will make some comments below look out-of-context)

Metadata

Metadata

Assignees

Labels

tyMulti-file analysis & type inference

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions