Skip to content

missing-argument when expanding a tuple #891

@PetterS

Description

@PetterS

Summary

Example code:

import random

def test(r: tuple[int, int]):
    x = random.randint(*r)
    print(x)

ty 0.0.1-alpha.15 (0369a3598 2025-07-18) says

error[missing-argument]: No arguments provided for required parameters `a`, `b` of bound method `randint`
 --> ty_test.py:4:9
  |
3 | def test(r: tuple[int, int]):
4 |     x = random.randint(*r)
  |         ^^^^^^^^^^^^^^^^^^
5 |     print(x)
  |
info: rule `missing-argument` is enabled by default

Interestingly, this works in the playground, but I'm not sure exactly which version is running there..

Version

0.0.1-alpha.15 (0369a35 2025-07-18)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions