satisfies
changes typechecking behavior
#60698
Labels
Duplicate
An existing issue was already created
satisfies
changes typechecking behavior
#60698
π Search Terms
satisfies upcast
,satisfies changes typechecking behavior
π Version & Regression Information
satisfies
β― Playground Link
Playground link
π» Code
π Actual behavior
This program fails to typecheck as written:
However, if we uncomment the
satisfies
expression on the second-to-last line, the type error goes away:π Expected behavior
My understanding from reading #47920 is that:
satisfies
does not perform safe upcaste satisfies T
should have the inferred typetypeof e
, rather thanT
orT & typeof e
Assuming both of these are correct, I would not expect
satisfies
to affect whether this function typechecks.Additional information about the issue
No response
The text was updated successfully, but these errors were encountered: