Remix.run Logo
debugnik 6 hours ago

It just isn't good enough. Anytime Pyright gives up in type checking, which is often, it simply decays the type into one involving Any/"Unknown":

Without strict settings, it will let you pass this value as of any other type and introduce a bug.

But with strict settings, it will prevent you from recovering the actual type dynamically with type guards, because it flags the existence of the untyped expression itself, even if used in a sound way, which defeats the point of using a gradual checker.

Gradual type systems can and should keep the typed fragment sound, not just give up or (figuratively) panic.