#5002·pyrefly

Feature: `assert_type_unspellable_subtype`

Author: rchen152Created Sep 22, 2026Updated Sep 22, 2026
Labelstypechecking

Describe the Bug

ty has a nice error kind called assert_type_unspellable_subtype that fires when (1) an assert_type fails, and (2) the actual type is assignable to the expected type, and (3) the actual type is not expressible using type annotations. This could be useful for pyrefly as well, so that for "unspellable" types like overloads, you can write an assert_type and suppress the assert_type_unspellable_subtype error without accidentally suppressing the broader assert_type error.

Sandbox Link

No response

(Only applicable for extension issues) IDE Information

No response