core.typed

Else branch does not tighten scope to non-sequential

Details

  • Type: Defect Defect
  • Status: Resolved Resolved
  • Priority: Major Major
  • Resolution: Completed
  • Affects Version/s: None
  • Fix Version/s: None
  • Component/s: None
  • Labels:
    None

Description

This error is related to the example longOptions.clj of CTYPE-102 and the derived hmap/big-options mentioned as CTYPE-99. I've prepared a new example to clearly show the issue.

The first function passes type-checking. However, it contains a redundant check on line 83 and a redundant base-case on line 85.

The second function does not pass the (check-ns) as it assumes that notifs can be a (seqable String). However, as this is the else-branch of line 112 (if (or (sequential? notifs) (seq? notifs) (vector notifs)) ... so the notifs can not be a (Seqable String) in this branch.

NOTE: core.typed does not know clojure.core/sequential? yet. Therefore the seq? and vector? tests are added too.

  1. failDerive1.clj
    19/Feb/14 1:48 AM
    6 kB
    Cees van Kemenade
  2. failDerive1a.clj
    20/Feb/14 9:50 AM
    9 kB
    Cees van Kemenade

Activity

People

Vote (0)
Watch (1)

Dates

  • Created:
    Updated:
    Resolved: