eg. File1
import File2
eg. File2
import File
The above imports are with cyclic dependencies in them. While the compiler is solving dependencies of modules, either the module pointers of File1 or File2 will be null. Until after all files are read, compiler is back with the null values and put them to the correct module pointers.
In static contexts, avoid touching anything related to cyclic dependencies or it fails, errors.
In dynamic contexts, all null module pointers are already set to correct value, using things inside those cyclic dependencies won't be problem.
No comments:
Post a Comment