Skip to content

Decorator on class method makes calling super() not possible #2646

@SebbyLaw

Description

@SebbyLaw

Summary

This could be user error with the type system and how we're typing this decorator:
https://play.ty.dev/db1c3bbf-0953-482e-b6df-b6c833ddde52

from typing import Any
from collections.abc import Callable


type Func = Callable[[Any], str]


def noop(func: Func) -> Func:
    """Does other stuff but returns the same function."""
    return func


class Base:
    @noop
    def foo(self) -> str:
        return "base"


class Derived(Base):
    @noop
    def foo(self) -> str:
        return super().foo()  # No argument provided for required parameter 1

Version

ty 0.0.14 (16597f5 2026-01-26)

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions