Skip to content

Support starred/splatted/unpacked arguments in function calls #247

@dreid

Description

@dreid

Status:

  • support single-starred arguments
  • support single-starred arguments in calls to overloaded functions
  • support double-starred arguments

Original description:

Summary

Minimal reproducer:

def foo(initial_arg: str, *args: str) -> None:
    ...

foo(*["a", "b", "c"])  # No argument provided for required parameter `initial_arg` of function `foo` (lint:missing-argument) [Ln 4, Col 1]
foo(*[1, "a", "b"])  # No argument provided for required parameter `initial_arg` of function `foo` (lint:missing-argument) [Ln 4, Col 1]

https://play.ty.dev/4b8dc795-03b5-4fbf-a5c3-639f9518e093

I'd expect first the invocation to type check because the splatted args have compatible types to cover both the first argument and the var args.

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingcallsIssues relating to call-signature checking and diagnostics

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions