core.typed

"swap!" doesn't work anymore due to missing type translation

Details

  • Type: Defect Defect
  • Status: Open Open
  • Priority: Critical Critical
  • Resolution: Unresolved
  • Affects Version/s: 0.2.0
  • Fix Version/s: None
  • Component/s: None
  • Labels:
    None
  • Environment:
    Clojure 1.6.0, core.typed 0.2.52

Description

Minimal test case:

Unable to find source-code formatter for language: clojure. Available languages are: javascript, sql, xhtml, actionscript, none, html, xml, java
(ns server.minimal
  (:refer-clojure :exclude [doseq let fn dotimes defprotocol loop for])
  (:require [clojure.core.typed :refer :all]))

(ann b (Atom1 (Vec String)))
(def b (atom []))

(swap! b (fn [in] in))

The error message is: "Type Error (server/minimal.clj:8:1) Internal Error (server/minimal.clj:8:1) First argument to TApp must be TFn, actual: clojure.lang.Fn

Activity

Hide
Ambrose Bonnaire-Sergeant added a comment -

Does this still appear in 0.2.58? It might have been fixed.

Note that the inference for swap! is a bit volatile; you may have to annotate the second argument's parameter types now.

Show
Ambrose Bonnaire-Sergeant added a comment - Does this still appear in 0.2.58? It might have been fixed. Note that the inference for swap! is a bit volatile; you may have to annotate the second argument's parameter types now.

People

Vote (0)
Watch (1)

Dates

  • Created:
    Updated: