packages required by A in its moduleinfo file, as shown here:
Here,
somepack is a placeholder for the package exported by B and used by A. Although
this works as long as A does not need to use anything defined in C, a problem occurs if
A
does want to access a type in C. In this case, there are two solutions.
The first solution is to simply add a requires C statement to A’s file, as shown here:
This solution certainly works, but if B will be used by many modules, you must add
requires C to all module definitions that require B. This is not only tedious; it is also
error prone. Fortunately, there is a better solution. You can create an
implied
Dostları ilə paylaş: