core.typed

ExactCount should work with destructuring

Details

  • Type: Enhancement Enhancement
  • Status: Resolved Resolved
  • Priority: Minor Minor
  • Resolution: Completed
  • Affects Version/s: None
  • Fix Version/s: 0.3.9, 0.3.x
  • Component/s: Clojure Checker
  • Labels:
    None
  • Patch:
    Code and Test

Description

Problem

ExactCount does not work with destructuring.

learning.core=> (cf (fn [[a b] :- (I (Vec Num) (ExactCount 2))] [(+ a b)]))
Type Error (/private/var/folders/34/98dbvkhn7v1clfvl5_y_fkc00001j3/T/form-init2527243481617671751.clj) Static method clojure.lang.Numbers/add could not be applied to arguments:


Domains:
	java.lang.Long java.lang.Long
	java.lang.Double java.lang.Double
	AnyInteger AnyInteger
	java.lang.Number java.lang.Number

Arguments:
	(U nil Number) (U nil Number)

Ranges:
	java.lang.Long
	java.lang.Double
	AnyInteger
	java.lang.Number

in: (clojure.lang.Numbers/add a b)
in: [(clojure.lang.Numbers/add a b)]



ExceptionInfo Type Checker: Found 1 error  clojure.core/ex-info (core.clj:4403)

Solution

This was fixed sometime before 0.3.8. Adding passing test to close this issue.

Pull request: 35
Patch: ctyp-172.patch
Commit: fb17b8
Release: 0.3.9

Activity

There are no comments yet on this issue.

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: