[ty] Fix incorrect diagnostic when calling __setitem__ (#19645)

## Summary

Resolves https://github.com/astral-sh/ty/issues/862 by not emitting a
diagnostic.

## Test Plan

Add test to show we don't emit the diagnostic
This commit is contained in:
Matthew Mckee
2025-07-30 19:34:52 +01:00
committed by GitHub
parent 7b4103bcb6
commit 4739bc8d14
3 changed files with 35 additions and 19 deletions

View File

@@ -253,7 +253,6 @@ does["not"]["exist"] = 0
reveal_type(does["not"]["exist"]) # revealed: Unknown
non_subscriptable = 1
# error: [non-subscriptable]
non_subscriptable[0] = 0
# error: [non-subscriptable]
reveal_type(non_subscriptable[0]) # revealed: Unknown