t/cast does not run under rewriting type checking

Description

Problem

The AST rewriting algorithm deletes the contract check for casts.

This passes static type checking, but does not run the code.

Solution

This happens because a t/cast expression is always rewritten to return `nil`. The AST rewriting algorithm should be fixed to preserve the original contract check.

Pull request: 92
Commit: a05205be
Version: 0.3.20

Environment

None
Completed
Your pinned fields
Click on the next to a field label to start pinning.

Assignee

Ambrose Bonnaire-Sergeant

Reporter

Ambrose Bonnaire-Sergeant