Skip to content

Ty cannot infer type with zip(tuple, tuple): reveals Unknown #2712

@AnJunHao

Description

@AnJunHao

Summary

from typing import reveal_type

a: tuple[int, ...] = 1, 2
b: tuple[str, ...] = "1", "2"

for c, d in zip(a, b):
    reveal_type(c)
    reveal_type(d)

I get:

Revealed type: Unknown (revealed-type) [Ln 7, Col 17]
Revealed type: Unknown (revealed-type) [Ln 8, Col 17]

I would expect c to be int, and d to be str.

reproduce in playground here:
https://play.ty.dev/4a5368e2-a55d-46cf-9f86-930863b61f83

The version I see in the playground is "2e7843727"

My local version is ty 0.0.14 (16597f5 2026-01-26), same issue.

Version

ty 0.0.14 (16597f5 2026-01-26)

Metadata

Metadata

Assignees

Labels

ProtocolsgenericsBugs or features relating to ty's generics implementation

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions