lshift/cloverage — pull request #43 by JacekLach (2014-03-13 23:25:05+00:00)
Title: cloverage loses primitive type hints

I posted a gist that reproduces this bug: [https://gist.github.com/stevemkim/9533037](https://gist.github.com/stevemkim/9533037)

I wrote a function that invokes a constructor with a type hint on a primitive argument:

(MersenneTwister. ^long (long seed))

When I run 'lein test', the tests pass and I don't see a reflection warning:

lein test cloverage-type-hint-bug.core-test

Ran 1 tests containing 2 assertions.
0 failures, 0 errors.

When I run 'lein cloverage', the tests fail and I see a reflection warning:

Loading namespaces: (cloverage-type-hint-bug.core)
Test namespaces: (cloverage-type-hint-bug.core-test)
Reflection warning, cloverage_type_hint_bug/core.clj:7:130 - call to org.apache.commons.math3.random.MersenneTwister ctor can't be resolved.
Loaded cloverage-type-hint-bug.core .
Instrumented namespaces.

Testing cloverage-type-hint-bug.core-test

FAIL in (test-foo) (core_test.clj:10)
foo invokes MersenneTwister(long seed) constructor
expected: (= (core/foo 0) (.nextDouble (MersenneTwister. (long 0))))
actual: (not (= 0.5488135008937807 0.15071724896777527))

FAIL in (test-foo) (core_test.clj:11)
foo invokes MersenneTwister(long seed) constructor
expected: (not= (core/foo 0) (.nextDouble (MersenneTwister. (int 0))))
actual: (not (not= 0.5488135008937807 0.5488135008937807))

Ran 1 tests containing 2 assertions.
2 failures, 0 errors.
Ran tests.
Produced output in /home/ubuntu/dev/cloverage-type-hint-bug/target/coverage .
HTML: file:///home/ubuntu/dev/cloverage-type-hint-bug/target/coverage/index.html

I think that cloverage loses the `^long` type hint that distinguishes which constructor method of [org.apache.commons.math3.random.MersenneTwister](http://commons.apache.org/proper/commons-math/javadocs/api-3.2/org/apache/commons/math3/random/MersenneTwister.html) to invoke.