<< Back to previous view

[CTYP-71] Occurrence typing does not deal well with non-eagerly simplifying unions Created: 26/Sep/13  Updated: 20/Jul/15  Resolved: 20/Jul/15

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

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


Bug introduced in 0.2.11.

(cf (fn> [a :- (U nil (Nilable java.util.Date))] 
      (when a 
        (ann-form a java.util.Date))))

Type Error (clojure.core.typed:1:87) Local binding a expected type java.util.Date, but actual type (U (Nilable java.util.Date) nil)
in: a

Type Error (clojure.core.typed:1:87) Type mismatch:

Expected:       java.util.Date

Actual:         (U (Nilable java.util.Date) nil)
in: a

ExceptionInfo Type Checker: Found 2 errors  clojure.core/ex-info (core.clj:4327)

Comment by Ambrose Bonnaire-Sergeant [ 20/Jul/15 10:31 AM ]

I didn't check but this is probably fixed.

Comment by Ambrose Bonnaire-Sergeant [ 20/Jul/15 11:06 AM ]

Ok, I went back and investigated.

There is a unit test proving this works, and we should close this.

However, this commented out test claims to be related
to CTYP-71 — this will be fixed in CTYP-249.

Generated at Sun Oct 22 23:33:19 CDT 2017 using JIRA 4.4#649-r158309.