Skip to content

fix: external trampoline type checking#494

Open
nicklafleur wants to merge 1 commit intoboxed:mainfrom
lyft:nicklafleur/fix_external_type_issues
Open

fix: external trampoline type checking#494
nicklafleur wants to merge 1 commit intoboxed:mainfrom
lyft:nicklafleur/fix_external_type_issues

Conversation

@nicklafleur
Copy link
Copy Markdown
Contributor

@nicklafleur nicklafleur commented Apr 10, 2026

Addresses issues introduced in #476

Changes:

  • Detects the Self annotation and replaces it with generics in mutated functions to support type checking
  • Normalize external trampoline naming conventions to the established patterns (this had some side-effects with type checking as well)

Tests:

  • add tests that validate inheritence of class/static methods passes type checking with the generic replacement

Ref: c866681

class Color(Enum)
    @classmethod
    def create(cls, name: str) -> Self:
        return cls(name)
...
_TxǁColorǁ = TypeVar('_TxǁColorǁ', bound='Color')

def xǁColorǁcreate__mutmut_orig(cls: type[_TxǁColorǁ], name: str) -> _TxǁColorǁ :
    return cls(name)

Changes:
- Detects the `Self` annotation and replaces it with generics
	in mutated functions to support type checking
- Normalize external trampoline naming conventions to the
	established patterns (this had some side-effects with
	type checking as well)

Tests:
- add tests that validate inheritence of class/static methods
	passes type checking with the generic replacement

Ref: boxed@c866681
@nicklafleur nicklafleur force-pushed the nicklafleur/fix_external_type_issues branch from 1235805 to e6a9ff3 Compare April 10, 2026 23:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant