Uploaded image for project: 'core.typed'
  1. CTYP-305

t/cast does not run under rewriting type checking

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Completed
    • Affects versions: 0.3.19
    • Fix versions: 0.3.20
    • Components: Clojure Checker
    • Labels:
      None

      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

        Attachments

          Activity

            People

            • Assignee:
              ambrosebs Ambrose BS
              Reporter:
              ambrosebs Ambrose BS
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: