core.typed

Type annotation for clojure.core/ex-info forbids nil message argument

Details

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

Description

The bug here is either in Clojure itself or core.typed, they don't agree on the arguments to clojure.core/ex-info.
I'm reporting it here because I have to pick somewhere

clojure.lang.ExceptionInfo allows null for the exception message, clojure.core/ex-info just passes the arguments straight to the ExceptionInfo constructor so it allows nil for the exception message.

I think the correct type annotation in core/typed/base_env.clj (given how ex-info is implemented) should be:

(ann clojure.core/ex-info (Fn [(Option String) (Map Any Any) -> clojure.lang.ExceptionInfo]
                              [(Option String) (Map Any Any) (Option Throwable) -> clojure.lang.ExceptionInfo]))

Activity

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: