Remix.run Logo
marcosdumay 3 days ago

That's not exactly what's done for functions. Scoping rules are always more complex than that.

But the good news is that the same rules are good for implicits too. You look back your tree to find a definition, and if it's defined only once on the most internal level, use that definition, otherwise require an explicit annotation. Add some way to annotate over the entire scope, and some way to export implicits globally for completeness.

This will lead to all kinds of problems with implicit imports that every other kind of named object has too. That's not a big deal, developers are used to those.