JetBrains / ruby-type-inference

Dynamic definitions and types provider for ruby static analysis
Apache License 2.0
137 stars 7 forks source link

Values tracking #3

Open valich opened 6 years ago

valich commented 6 years ago

In several cases using just types to create contracts is just not enough. The example is FactoryGirl's mock class creation which returns objects of class derivable from symbol value by fixed algorithm, for example, underscore->camelcase conversion.

One could achieve such results by sending the values of some string/symbol type arguments along with their types. Unfortunately, doing so plainly must dramatically reduce the speed of arg-scanner execution (which is not great already).

The possible approach is to consider only the "short" values given as a separate parameter OR as an explicit hash value (required to deal with factory :admin, class: User do calls)