core.typed

Core.typed doesn't understand inner class syntax inside non-nil-return

Details

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

Description

Following code snippet illustrates that non-nil-return call has no effect on recipient-type-to function.
Core.typed still assumes that Message$RecipientType/TO can return nil.

(non-nil-return javax.mail.Message$RecipientType/TO :all)

(ann recipient-type-to [-> Message$RecipientType])
(defn ^Message$RecipientType recipient-type-to []
  (Message$RecipientType/TO))

(comment
  Type mismatch:
  Expected:       (Fn [-> Message$RecipientType])
  Actual:         (Fn [-> (U Message$RecipientType nil)]))

Activity

Hide
Ambrose Bonnaire-Sergeant added a comment -

This is not an issue with inner class syntax.

This is rather about nilable fields. TO here is a static field, nilable-param only takes methods.

core.typed doesn't yet support overriding fields.

Show
Ambrose Bonnaire-Sergeant added a comment - This is not an issue with inner class syntax. This is rather about nilable fields. TO here is a static field, nilable-param only takes methods. core.typed doesn't yet support overriding fields.

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: