core-typed

Typed Clojure, an optional type system for Clojure
drone 2018-12-21T05:10:02.000800Z

I’m running into an issue where it appears core.typed isn’t getting return type information for a class static method

drone 2018-12-21T05:10:09.001Z

any idea if that’s a known issue?

drone 2018-12-21T05:10:19.001300Z

this is with core.typed 0.6.0

drone 2018-12-21T05:19:19.001500Z

also tried with 0.7.0

drone 2018-12-21T05:48:02.002200Z

I was seeing TCerror as the type for something that was assigned a return value from a static method

drone 2018-12-21T05:49:42.003500Z

I’m also seeing that core.typed assigns a (U nil ReturnType) to everything coming from other Java static methods. there must be a better way to “fix” that besides from (cast ReturnType <form>)

2018-12-21T13:50:30.003900Z

@mrevelle c.c.t/non-nil-return might help

2018-12-21T13:51:52.005500Z

but things shouldn't return TCError, please report a reproducible ticket on jira or the mailing list. thanks!

2018-12-21T13:59:03.008Z

@genekim I just realized I missed a message from you a few months ago (about https://github.com/realgenekim/core.typed.ex1). Sorry about that. I only have a small amount of attention to offer right now-- it looks like you're trying to type check the specs, which isn't supported. You can only type check type annotations, with lein infer-type IIRC.

drone 2018-12-21T15:00:38.008300Z

@ambrosebs thanks!

drone 2018-12-21T15:34:26.009200Z

similar question, how does one annotate to avoid the union with nil if I have a static field from a Java class that I want to be treated as non-nil?

genekim 2018-12-21T16:13:42.009800Z

Thank you @ambrosebs !! Keep up the great work!!!