Unsafe cast #21
Reference in New Issue
Block a user
Delete Branch "feat/unsafe-cast"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
This PR adds a
typingsubmodule to Midas with two functionscastandunsafe_cast. These functions should be used instead ofcastfrom the stdlibtypingmodule.unsafe_castallows the user to tell the type checker the type of an expression without generating any runtime assertion. This can be useful when we want to avoid large amounts of computation at runtime, sacrificing a little safety for performance.