Skip to content

Fix ty typecheck errors with explicit dict annotations#7

Merged
ewels merged 1 commit intomainfrom
fix/ty-check-type-annotations
Mar 23, 2026
Merged

Fix ty typecheck errors with explicit dict annotations#7
ewels merged 1 commit intomainfrom
fix/ty-check-type-annotations

Conversation

@ewels
Copy link
Copy Markdown
Owner

@ewels ewels commented Mar 23, 2026

Summary

  • Add explicit dict[str, Any] type annotations to dict literals in to_dict() methods (models.py) and _send_notification() (lsp_client.py)
  • Fixes 6 invalid-assignment errors from ty check src/ where the checker inferred overly narrow dict types from initial literal values

Test plan

  • ty check src/ passes with zero diagnostics
  • Pre-commit hooks (ruff, ruff-format, ty) all pass

🤖 Generated with Claude Code

Add `dict[str, Any]` annotations to dict literals in `to_dict()` methods
and `_send_notification()` to prevent ty from inferring overly narrow
types that reject later assignments of different value types.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@ewels ewels merged commit c374c29 into main Mar 23, 2026
8 checks passed
@ewels ewels deleted the fix/ty-check-type-annotations branch March 23, 2026 15:48
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