ty icon indicating copy to clipboard operation
ty copied to clipboard

No argument errors reported when a class is used as a decorator

Open MeGaGiGaGon opened this issue 1 week ago • 2 comments

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

MeGaGiGaGon avatar Dec 26 '25 22:12 MeGaGiGaGon

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!

AlexWaygood avatar Dec 26 '25 23:12 AlexWaygood

Oops, I didn't open the example

MeGaGiGaGon avatar Dec 26 '25 23:12 MeGaGiGaGon