The augmentations resolution order is as follows:
locally applied augmentations:
augment MyType { ... },
augmentation Foo = { ... }
and augment MyType with Foo in the current module. Multiple
applications are searched in the application order,
augmentation Foo = { ... } in module Augmentations, and
augment MyType with Augmentations.Foo in the current module,
augmentation Foo = { ... } in module Augmentations, and
augment MyType with Foo in the current module that import Augmentations
(imported module are searched in the importation order),
The first matching method found is used. It is thus possible to “override” an augmentation with a more higher priority one (in the sens of the previous order).
Since importing a module imports all the applied augmentations, and given the somewhat complex resolution order when involving simple and named augmentations, being local, external or imported, and involving class hierarchies, knowing which method will be applied on a given type can be difficult. A good modularisation and a careful application are recommended.