<< Back to previous view

[CTYP-62] comparison with value from (HMap) leads to erroneous always-true Created: 15/Sep/13  Updated: 25/Sep/13  Resolved: 18/Sep/13

Status: Closed
Project: core.typed
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Defect Priority: Major
Reporter: Chris Spencer Assignee: Ambrose Bonnaire-Sergeant
Resolution: Completed Votes: 0
Labels: None


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

user=> (cf (if (= (:a (ann-form {} (HMap)))
               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}]

Comment by Chris Spencer [ 15/Sep/13 5:21 PM ]

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}]
Comment by Ambrose Bonnaire-Sergeant [ 18/Sep/13 4:44 AM ]

Fixed with https://github.com/clojure/core.typed/commit/1fa44df8c1e341be333f06562a807f73d38ecda2

Please verify with 0.2.8-20130918.094405-3

Generated at Wed Jan 17 07:12:41 CST 2018 using JIRA 4.4#649-r158309.