Regression?

23 views
Skip to first unread message

Mark Feeney

unread,
Jun 25, 2015, 11:53:47 PM6/25/15
to clojure-c...@googlegroups.com
I'm pretty sure this should type check (?)

(t/fn [m :- (t/Map t/Kw String)] :- String 
  (or (:foo m) "asdf"))

I tried a few versions:

0.2.92, 0.3.0-alpha5, 0.3.0 - Thinks type is Any
0.2.58 - ok

Please advise if I'm missing something here.

Thanks!


Mark

Ambrose Bonnaire-Sergeant

unread,
Jun 25, 2015, 11:56:09 PM6/25/15
to core.typed
Yes I think so. Can you help narrow down the version this breaks in?

Thanks,
Ambrose

Mark Feeney

unread,
Jun 26, 2015, 12:27:51 AM6/26/15
to clojure-c...@googlegroups.com
git bisect suggests it's this:

9608027bfaf4be268cfa12486c5ae6615d8517f1 is the first bad commit
commit 9608027bfaf4be268cfa12486c5ae6615d8517f1
Author: Ambrose Bonnaire-Sergeant <...@gmail.com>
Date:   Sat Jan 3 00:05:23 2015 +0000

    enable aliasing support

Mark Feeney

unread,
Jun 26, 2015, 12:35:16 AM6/26/15
to clojure-c...@googlegroups.com
FYI, my test case was just the original code above:

(do (require '[clojure.core.typed :as t]) (t/cf (t/fn [m :- (t/Map t/Kw String)] :- String (or (:foo m) "asdf"))))

Ambrose Bonnaire-Sergeant

unread,
Jun 26, 2015, 12:43:25 AM6/26/15
to core.typed
Thanks! Please open a JIRA ticket with this information.

BTW can you share how you did this with `git bisect`, I've never used it.

Thanks,
Ambrose

Mark Feeney

unread,
Jun 26, 2015, 10:29:42 AM6/26/15
to clojure-c...@googlegroups.com
Created http://dev.clojure.org/jira/browse/CTYP-241

`git bisect` -- sure.  It's pretty handy.

You need three things:
0) a test (script, or manual actions) to check for the problem (for this I just ran the repl with the above test code)
1) a commit where the problem exists (for this it was HEAD)
2) a commit where the problem does not exist (for this it was the tag core.typed-pom-0.2.58, which I found by trial and error)

git checkout master
git bisect start
# run the test code, ensure it fails
git bisect bad
git checkout core.typed-pom-0.2.58
# run the test code, ensure it works
git bisect good

Git now does a binary search, automatically moving you to the commit in between the closest "bad" and "good".  You then run the test again, then record the result with `git bisect good` or `git bisect bad`.  Eventually you converge on where the problem first appeared.

You can also use `git bisect run mycript myarg0 myarg1 ...` to fully automate this.  I didn't do that here because I couldn't figure out how to make leiningen run an expr from the command line, and it was pretty fast to do by hand anyway.
Reply all
Reply to author
Forward
0 new messages