aboutsummaryrefslogtreecommitdiffstats
path: root/lib/dialyzer/test/small_SUITE_data/src/spec_other_module.erl
AgeCommit message (Collapse)Author
2019-05-03stdlib: Do not allow specs for functions in other modulesHans Bolinder
See also https://bugs.erlang.org/browse/ERL-845. [Kostis:] My suggestion is that the compiler refuses to compile modules that contain specs for functions that are not from this module. I do not remember when / why this `feature' was introduced, but thinking about it I see a lot of (ugly) semantics issues with it. For example, should one be allowed to declare in the foo module that lists:flatten/1 takes an integer() as an argument and returns a binary()? Should one be allowed to declare a spec in some module m1 for a function of m2 that is not defined in m2? There are all kinds of checks that will need to be added to dialyzer to protect itself from these semantics issues. The compiler already refuses to compile modules that contain specs for non-existing functions of the module. Similarly, it should refuse to compile modules that contain specs for functions of other modules - unless it can somehow check that these functions are indeed defined, but it is not how the compiler currently works.
2019-02-06dialyzer: Fix a bug regarding contractsHans Bolinder
See also https://bugs.erlang.org/browse/ERL-845. Fix a bug that caused Dialyzer to crash when analyzing a contract with a module name differing from the analyzed module's name. The bug was introduced in Erlang/OTP 18.