<< Back to previous view

[CTYP-27] clojure.lang.RT/nth's type doesn't currently allow nil as the first argument Created: 23/Jul/13  Updated: 21/Jul/15  Resolved: 21/Jul/15

Status: Resolved
Project: core.typed
Component/s: Clojure Checker
Affects Version/s: None
Fix Version/s: 0.3.8, 0.3.x

Type: Defect Priority: Minor
Reporter: Alan Busby Assignee: Ambrose Bonnaire-Sergeant
Resolution: Completed Votes: 0
Labels: None

Attachments: Text File ctyp-27.patch    
Patch: Code and Test



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


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


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"


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

Comment by Ambrose Bonnaire-Sergeant [ 23/Jul/13 6:09 AM ]

Sorry, master is a bit broken at the moment. It may take a week to get it stable actually!

Comment by Ambrose Bonnaire-Sergeant [ 27/Jul/13 9:41 AM ]

This needs a special case for invoke-nth, to handle things like (nth (I (Seqable x) (CountRange 1)) 0).

Generated at Fri Sep 22 08:23:37 CDT 2017 using JIRA 4.4#649-r158309.