<< Back to previous view

[CTYP-72] merge doesn't seem to like records Created: 28/Sep/13  Updated: 28/Sep/13

Status: Open
Project: core.typed
Component/s: None
Affects Version/s: 0.2.0
Fix Version/s: None

Type: Defect Priority: Major
Reporter: Julian Birch Assignee: Ambrose Bonnaire-Sergeant
Resolution: Unresolved Votes: 0
Labels: None


 Description   

I'm pretty sure this should pass

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

(ann-record X [a :- Number])
(defrecord X [a])

(ann x X)
(def x (merge (X. 3) {:z 4}))

but it gives

Type Error (moonrise:8:8) Polymorphic function clojure.core/merge could not be applied to arguments:
Polymorphic Variables:
k
v

Domains:
nil *
(clojure.lang.IPersistentMap k v) (clojure.lang.IPersistentMap k v) *
(Option (clojure.lang.IPersistentMap k v)) *

Arguments:
moonrise.X (HMap :mandatory {:z (Value 4)} :complete? true)

Ranges:
nil
(clojure.lang.IPersistentMap k v)
(Option (clojure.lang.IPersistentMap k v))

with expected type:
moonrise.X

in: (clojure.core/merge (new moonrise.X 3) (quote {:z 4}))
in: (def x (clojure.core/merge (new moonrise.X 3) (quote {:z 4})))

Type Checker: Found 1 error


Generated at Mon Sep 15 22:02:26 CDT 2014 using JIRA 4.4#649-r158309.