DIP 1005 provides new syntax to make it possible to avoid global imports. Till now global imports are necessary if a function uses types declared in some imported module within it's declaration or definition (otherwise a local import will do).

But this can already be worked around with some nice trick:

import someModule.SomeType;

SomeType fun()
{
   ...
}

can be replaced by:

fun.ST fun()
{
   import someModule.SomeType;
   alias ST = SomeType;
   ...
}

The same strategy works with types used in parameters or constraints, of course.

Any thoughts?

Reply via email to