ty
ty copied to clipboard
No argument errors reported when a class is used as a decorator
Summary
Found this while messing around, if using a class as a decorator ty does not report any errors. https://play.ty.dev/d188d05e-e59b-44f7-8085-f180fd667424
class A: ...
@A # Should have a too-many-positional-arguments error
def foo(): ...
@int # Should have a invalid-argument-type error
def bar(): ...
Version
ty 0.0.7 (cf82a04b5 2025-12-24) playground 9693375e1
I don't think this is a duplicate of #143, actually. That issue is about decorators being applied to classes. These examples seem to be classes being used as decorators, which seems pretty distinct!
Oops, I didn't open the example