On 08/20/2015 11:00 PM, deadalnix wrote:
On Thursday, 20 August 2015 at 20:27:58 UTC, Timon Gehr wrote:
- We'd like to be able to lazy import as much as possible. If import
can hijack,
I assume what you mean is if it can cause a compiler error due to
ambiguity in cross-scope overloading.
Yes, but eve if it doesn't, one need to do a lookup in the imports to
check, which is undesirable.
then it is necessary to process them at least enough to be
able to do first level lookup, even if the import is not used.
Makes sense. So the scenario we are looking at here is basically local
imports in aggregate scopes, such that the imported symbols are not
used in method signatures? Are those common enough to improve
performance sufficiently to justify influencing the choice of best
semantics? (There are 0 cases in my own code.)
On the long run, it is typical for code to have unused imports,
especially since we have no linter to warn about them.
I think this is a very weak point, so I didn't consider it.
Even if an import is unused, if there is at least one lookup of some
identifier from any different module, it will have to be analyzed.
Also, in the long run, we'll have the linter. Given a front end, it's
exceedingly simple to create.