Skip to content

Intersection of fixed-length tuple with another type should be unpackable like the fixed-length tuple  #1978

@SuperKenVery

Description

@SuperKenVery

Summary

Here's an example:
https://play.ty.dev/948638ab-b0a1-45bf-a945-88d9b60a6dc9

Note the error message:

Return type does not match returned value: expected `int`, found `str | int`

This is not expected. There should be no error.

I initially came up with a more complex reproduction. Thanks to @rijuyuezhu for providing an even simpler reproduction.

Version

ty 0.0.2

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingset-theoretic typesunions, intersections and more

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions