I try to find out what does requires static means and when should I use it.
Short answer is: A requires static
clause expresses a dependency that is optional at run time. Frankly speaking I don't understand practical use of it. This is the crux of the matter
I found following explanation: quote from article:
Sometimes we write code that references another module, but that users of our library will never want to use.
For instance, we might write a utility function that pretty-prints our internal state when another logging module is present. But, not every consumer of our library will want this functionality, and they don’t want to include an extra logging library.
In these cases, we want to use an optional dependency. By using the requires static directive, we create a compile-time-only dependency:
module my.module {
requires static module.name;
}
But it is absolutely unclear for me. Could anyone explain it in a simple way?