Skip to content

Starred expression not checked when used in function argument #2582

@abgros

Description

@abgros

Summary

This incorrect code passes type checking:

def some_fn(a: int):
    pass

some_fn(*None)

But fails at runtime:

TypeError: some_fn() argument after * must be an iterable, not NoneType

On the other hand, this is correctly flagged as an error:

b = *None

https://play.ty.dev/952eb26e-1acb-481f-b419-8e15f3c2a84a

Version

ty 0.0.7

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingruntime semanticsAccurate modeling of how Python's semantics work at runtime

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions