This is the mail archive of the kawa@sourceware.org mailing list for the Kawa project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Mutual require bug when compiling?


Hi Per,

Thanks! That fixes the mutual require problem we were having.

Unfortunately, the duplicate definition warnings are still showing up in our
main project. I've tried putting in some print statements in ModuleManager
and ModuleInfo, and it seems that the modules are NOT being instantiated
more than once - the second time a require is encountered for the same
module, it successfully retrieves the ModuleInfo. It also seems that it is
always using findWithSourcePath, so I don't think its mistakenly
mis-identifying modules. Despite this, ImportDefinitions in require.java is
still calling ScopeExp.duplicateDefinitionError when the second require is
encountered. Perhaps the code in ImportDefinitions is mistakenly thinking
that the definitions are from a different module, even though they are from
the same module required in a different file?

Would it be ok if I send you the offending file directly so that you can see
if you see the same warnings?

Thanks for all your help.

Alex


On 8/8/09 2:30 PM, "Per Bothner" wrote:

> On 08/06/2009 06:30 PM, alex mitchell wrote:
>> Following up on the earlier duplicate require problems that we were
>> encountering, we¹ve come across what seems to be a problem with mutual
>> requires when compiling, which may be related.
> 
> I just checked in a patch which might help.
> 
> A 'require' at run-time becomes a "find the class"
> followed by "run its body".  In the case of a cycle
> we would end up doing these (i.e. run the body of the
> imported module) at the end of the (importing) module.
> Which means some initialization didn't happen until too late.
> 
> The patch I just checked in makes sure the "run" happens
> in teh same place as the "require", so things should be
> more as expected.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]