ruby/typeprof

Odd results with lib/matrix

marcandre opened this issue · 1 comments

See this PR and this comment I made Updated below

In particular, if I give a type of @rows, I was expecting to see attr_reader rows : <exact same type here>. Instead I get a complex expression.

(Updated as of f881fbe)

So an initial commit shows result without any hint.
With this commit I tell it Matrix@rows and Vector@elements which should help a lot... but it doesn't improve things much.

First, I was expecting attr_reader rows : Array[Array[numeric]] (if it could reuse my type definition), or Array[Array[Integer | Float | Rational | Complex]] otherwise.

The result I get is really complex and includes Array[(... | String)?], this is very wrong.

Another good test is to_a, which should have the same signature, but I get a simple answer this time (Array[(Integer | String)?]), but it is invalid.