<< Back to previous view

[CTYP-239] Search for .cljc files when checking a namespace Created: 25/Jun/15  Updated: 03/Dec/17  Resolved: 19/Oct/15

Status: Closed
Project: core.typed
Component/s: Core type system
Affects Version/s: None
Fix Version/s: 0.3.12, 0.3.x

Type: Enhancement Priority: Minor
Reporter: Alejandro Assignee: Alejandro
Resolution: Completed Votes: 0
Labels: readerconditionals

Attachments: Text File 0001-Add-basic-unit-tests-for-CTYP-239.patch     Text File 0001-CTYP-239-Search-for-.cljc-files-when-checking-a-name.patch    
Patch: Code
Waiting On: Ambrose Bonnaire-Sergeant

 Description   

Currently core.typed assumes that Clojure files end with a .clj extension and ClojureScript files with .cljs. However, due to the introduction of reader conditionals to the language the .cljc extension is now valid for both Clojure and ClojureScript. core.typed should look for .cljc files in addition to .clj and .cljs.

The problem originates in the clojure.core.typed.coerce-utils namespace's ns->file function, since it hardcodes the .clj and .cljs extensions for finding Clojure and ClojureScript namespaces. When using this function from clojure.core.typed.analyze-clj namespace's ast-for-ns function it throws an exception.

Pull request: 58

Commits: 8dd3099 81aa140

Version: 0.3.12



 Comments   
Comment by Alejandro [ 25/Jun/15 9:38 AM ]

Since the current version of tools.analyzer.jvm that core.typed depends on doesn't support .cljc files the patch can't be applied yet.

Comment by Ambrose Bonnaire-Sergeant [ 19/Jul/15 11:16 AM ]

The latest tools.analyzer.jvm is inlined at clojure.core.typed.deps.clojure.tools.analyzer.jvm (see project.clj for the version).

Can this now move forward?

Comment by Brendan Tobolaski [ 31/Aug/15 1:47 PM ]

I see that there is a pull request for this on GitHub but it doesn't appear to have been merged onto master yet. Is this waiting on anything in particular?

Comment by Ambrose Bonnaire-Sergeant [ 31/Aug/15 2:18 PM ]

I'd merge if there was a test.

Comment by Piotr Jarzemski [ 24/Sep/15 2:18 PM ]

I created a basic set of unit tests for this issue (https://github.com/typedclojure/core.typed/pull/63). If that's not enough or if they aren't matching your requirements, please let me know.





Generated at Thu Apr 25 18:56:07 CDT 2019 using JIRA 4.4#649-r158309.