Heads-Up: Sway Path Resolution Incoming Update

Hey builders,
We want to give a heads-up regarding the PR that we will be merging soon which fixes path resolution bugs in Sway. This isn’t released yet, but it will be soon. This wont break correctly written imports, but it may break codebases that rely on this bug.

What’s Changing?

In some cases, you could import a symbol foo from a package bar like this:

use ::bar::foo;

and pretending that it is at the root of your tree. This was always incorrect, but worked due to a bug. Going forward, you’ll need to use the correct format:

use bar::foo;

The :: prefix is reserved for symbols that are part of your own package’s namespace.

What to do?

If you used the semantically correct imports, you won’t have any issues. If not, you will need to review your imports again.