You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If we don't mention a type, but it is needed to typecheck a mentioned method and we declare a dependency on the module, we shouldn't error but automatically import.
If we don't depend on the module we need, we should error but explain the solution is add a dependency on a certain module.
It's a bit weird to have two different rules, but the real rule is that by reading the code a human or simple tool can see the dependency structure of the code, and we shouldn't otherwise need to import names not used in the code.
The text was updated successfully, but these errors were encountered:
we should be able to read the code and see where all names came from
we should be able to see package dependency graph via parsing, without type checking
So, if you use a function, but don't mention one of the types it needs, but we do depend on that package already, we shouldn't error. So, one way we could do that is look at all values imported, and then traverse the set of all root type constants. Any type constants from imported packages, we can import. This should happen after SourceConverter, so that it doesn't allow you to name in the source types or constructors without importing, but we shouldn't have to import a type from a package we already depend on just to satisfy inference.
If we don't mention a type, but it is needed to typecheck a mentioned method and we declare a dependency on the module, we shouldn't error but automatically import.
If we don't depend on the module we need, we should error but explain the solution is add a dependency on a certain module.
It's a bit weird to have two different rules, but the real rule is that by reading the code a human or simple tool can see the dependency structure of the code, and we shouldn't otherwise need to import names not used in the code.
The text was updated successfully, but these errors were encountered: