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

Assignee

Ambrose Bonnaire-Sergeant

Reporter

Ambrose Bonnaire-Sergeant

Labels

None

Approval

None

Patch

None

Components

Fix versions

Affects versions

Priority

Major