Closed EvanKirshenbaum closed 5 months ago
This issue was referenced by the following commits before migration:
Everything's all nice and refactored, though not tremendously well tested.
Type
s now know their CallableType
super, which means that I could get rid of all the special-casing for DIR
, ON
, and OFF
in visitInjection()
. CallableType
(actually Signature
) now creates a wrapper CallableValue
when it needs to convert. <
now reasons based on whether or not it can find a conversion.else
clauses work, conditionals now use upper_bound()
to figure out their return type, which is probably the right thing to do.
While trying to implement
prompt
(#219), and reworking the injection logic, it became clear that the type conversion scheme is in drastic need of an overhaul.In particular, it would be nice if
DIR
orON
, so that I didn't need to have special cases everywhere.CallableValue
should be able to provide a wrapper value to take the types it is provided and do conversions on input and output automatically.CallableValue
should do proper narrowing (covariant param types, contravariant return types)Migrated from internal repository. Originally created by @EvanKirshenbaum on Jan 24, 2023 at 12:02 PM PST. Closed on Jan 26, 2023 at 5:38 PM PST.