Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Better check for funs referring to imports
The linting of 'fun f/n' relied on marking f/n as used and later getting a report if function f/n did not exist, except if f/n was not in the list of local functions (could still be local but auto generated) and was listed in auto-imports (erlang:f/n) and the import was not suppressed. This allowed explicit imports of names such as 'max/2' to slip through with a warning, assuming that they were auto-imports, and the expander would then expand them like an explicit import. This change avoids marking f/n as a used local if it is listed as an import, makes it an error to have a 'fun f/n' that refers to an explicit import, and furthermore checks the reference f/n just like a call f(X1, ... Xn) so that we get the same warnings for deprecated functions etc., for example 'fun now/0'.
- Loading branch information