t/cast does not run under rewriting type checking

Description

Problem

The AST rewriting algorithm deletes the contract check for casts.

(cf (cast Int nil)) ;=> Int

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

Activity

Show:
Completed

Details

Assignee

Reporter

Components

Fix versions

Affects versions

Priority

Created January 28, 2016 at 9:51 PM
Updated December 3, 2017 at 11:07 PM
Resolved December 3, 2017 at 11:07 PM

Flag notifications