core.typed

comparison with value from (HMap) leads to erroneous always-true

Details

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

Description

Following should be (U (Value 5) (Value 6)) I think (given no knowledge of the {} keys)

user=> (cf (if (= (:a (ann-form {} (HMap)))
                  "6")
               5 6))
[(Value 5) {:then tt, :else ff}]

I think the smaller case is:

user=> (cf (= (:a (ann-form {} (HMap))) "6"))
[(U true false) {:then tt, :else ff}]

Activity

Hide
Chris Spencer added a comment - - edited

Maybe helpful for debugging, correct and incorrect smaller cases:

user=> (cf (= (ann-form 1 Any) 3))
(U true false)
user=> (cf (= (ann-form 1 Any) "3"))
[(U true false) {:then tt, :else ff}]
user=> (cf (= (ann-form 1 Any) {}))
[(U true false) {:then tt, :else ff}]
Show
Chris Spencer added a comment - - edited Maybe helpful for debugging, correct and incorrect smaller cases:
user=> (cf (= (ann-form 1 Any) 3))
(U true false)
user=> (cf (= (ann-form 1 Any) "3"))
[(U true false) {:then tt, :else ff}]
user=> (cf (= (ann-form 1 Any) {}))
[(U true false) {:then tt, :else ff}]
Hide
Ambrose Bonnaire-Sergeant added a comment -
Show
Ambrose Bonnaire-Sergeant added a comment - Fixed with https://github.com/clojure/core.typed/commit/1fa44df8c1e341be333f06562a807f73d38ecda2 Please verify with 0.2.8-20130918.094405-3

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: