core.typed

Occurrence typing does not deal well with non-eagerly simplifying unions

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

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)

Activity

Hide
Ambrose Bonnaire-Sergeant added a comment -

I didn't check but this is probably fixed.

Show
Ambrose Bonnaire-Sergeant added a comment - I didn't check but this is probably fixed.
Hide
Ambrose Bonnaire-Sergeant added a comment - - edited

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.

Show
Ambrose Bonnaire-Sergeant added a comment - - edited 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.

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: