core.typed

Having trouble typing core.string/blank?

Details

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

Description

(ns moonrise
(:require [clojure.core.typed :refer :all]
[clojure.string :as s]))

(cf (ann core.string/blank? [String -> Boolean]))

(ann x [String -> Boolean])
(defn x [s] (s/blank? s))

Fails.

Apologies if this is wrong.

Activity

Hide
Ambrose Bonnaire-Sergeant added a comment -

I don't know. Perhaps at the end of type checking a namespace I can check if a var exists for each annotation. I don't think it's really feasible for REPL development though.

Show
Ambrose Bonnaire-Sergeant added a comment - I don't know. Perhaps at the end of type checking a namespace I can check if a var exists for each annotation. I don't think it's really feasible for REPL development though.
Hide
Julian Birch added a comment -

Clunk. You're absolutely right. Assuming there's no (cf) there, is there any way you could log an error for an annotation with no associated actual definition? Obviously, to be useful, it'd have to appear in the appropriate location in the file.

Show
Julian Birch added a comment - Clunk. You're absolutely right. Assuming there's no (cf) there, is there any way you could log an error for an annotation with no associated actual definition? Obviously, to be useful, it'd have to appear in the appropriate location in the file.
Hide
Ambrose Bonnaire-Sergeant added a comment -

I think core.string/blank? should be clojure.string/blank?. Also cf is not allowed inside a typed file.

Show
Ambrose Bonnaire-Sergeant added a comment - I think core.string/blank? should be clojure.string/blank?. Also cf is not allowed inside a typed file.

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: