erlang/otp — pull request #311 by aronisstav (2014-03-26 18:06:10+00:00)
Title: Dialyzer now plays nicely with funs that come as "external" arguments

Two steps are needed to make this work:

1) Avoid generating the additional "apply_constraint" in dialyzer_typesig by
reporting every function argument as a potential external function (patch on
dialyzer_dep).

This will produce correct success typings for all functions in the test case,
but dataflow would miss the key warnings that help identify the bugs.

2) Patch dialyzer_dataflow so that it uses the "handle just external" path as a
fallback whenever there are any external calls. As a result, if we have info
about some paths, then:

a) use the old "handle known apply" code to mark these functions as used and
b) ignore the generalized result and use the one found by typesig for the
return value of the apply itself.