core.typed

clojure.lang.RT/nth's type doesn't currently allow nil as the first argument

Details

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

Description

Problem

The destructuring of (let [[x] [1 2 3]] x) is type checked differently to
(first [1 2 3]), the former being a type error.

Solution

Already fixed sometime around 0.1.18, but adding tests to prove this works.

Notes

Re: Why (first [1 2 3]) isn't equivalent to (let [[x & xs] [1 2 3]] x)
"
; This is because clojure.lang.RT/nth's type doesn't currently allow nil as
; the first argument. Should be fixed in master, but please submit a bug report to
; JIRA, it might not be completely correct.
; -Ambrose"

From
https://github.com/frenchy64/type-examples/blob/master/src/type_examples/core.clj

I'm not sure if this is fixed in master, but I couldn't build the current 0.1.18-SNAPSHOT (master) to check.

Pull request: CTYP-27
Patch: ctyp-27.patch
Commit: f4c699d
Release: 0.3.8

Activity

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: