From bcddab6680f5026718094a630e2891f79488a55a Mon Sep 17 00:00:00 2001 From: Glyphack Date: Thu, 2 Oct 2025 21:27:10 +0200 Subject: [PATCH] Add test case --- .../resources/mdtest/annotations/cls.md | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 crates/ty_python_semantic/resources/mdtest/annotations/cls.md diff --git a/crates/ty_python_semantic/resources/mdtest/annotations/cls.md b/crates/ty_python_semantic/resources/mdtest/annotations/cls.md new file mode 100644 index 0000000000..21e2049c8a --- /dev/null +++ b/crates/ty_python_semantic/resources/mdtest/annotations/cls.md @@ -0,0 +1,20 @@ +# `cls` + +```toml +[environment] +python-version = "3.13" +``` + +## Methods + +```py +from typing import Type, Self + +class C: + @classmethod + def make_instance(cls: Type[Self]) -> Self: + return cls() + +reveal_type(C.make_instance()) # revealed: C +reveal_type(C.make_instance) # revealed: bound method .make_instance() -> C +```