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

Ambrose Bonnaire-Sergeant made changes -
Field Original Value New Value
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)
Bug introduced in 0.2.11.

{code}
(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)
{code}
Ambrose Bonnaire-Sergeant made changes -
Resolution Completed [ 1 ]
Status Open [ 1 ] Resolved [ 5 ]
Ambrose Bonnaire-Sergeant made changes -
Status Resolved [ 5 ] Closed [ 6 ]
Ambrose Bonnaire-Sergeant made changes -
Status Closed [ 6 ] Reopened [ 4 ]
Resolution Completed [ 1 ]
Ambrose Bonnaire-Sergeant made changes -
Resolution Completed [ 1 ]
Status Reopened [ 4 ] Resolved [ 5 ]
Ambrose Bonnaire-Sergeant made changes -
Status Resolved [ 5 ] Closed [ 6 ]
Ambrose Bonnaire-Sergeant made changes -
Status Closed [ 6 ] Reopened [ 4 ]
Resolution Completed [ 1 ]
Ambrose Bonnaire-Sergeant made changes -
Resolution Completed [ 1 ]
Status Reopened [ 4 ] Closed [ 6 ]

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: