Skip to content

TypeVar bound to Callable not callable #480

@danielhollas

Description

@danielhollas

Summary

import typing as t

C = t.TypeVar('C', bound=t.Callable[..., t.Any])

def callable_typevar(f: C):
    return f()
uvx ty check test.py 
error[call-non-callable]: Object of type `C` is not callable
 --> test.py:6:12
  |
5 | def callable_typevar(f: C):
6 |     return f()
  |            ^^^
  |
info: rule `call-non-callable` is enabled by default

Found 1 diagnostic

https://play.ty.dev/7bb16762-80fd-4ca6-b8f2-e4922c210160

Perhaps related to #95?

Version

0.0.1-alpha.6

Metadata

Metadata

Assignees

Labels

bugSomething isn't workinggenericsBugs or features relating to ty's generics implementation

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions