This is a bug. In the upcoming 2.2 release both attempts will fail with the error:
Local variable is accessed at a different place, and therefore it must be initialized and declared final. So you cannot access a local variable in a different place unless it is initialized and "val". In 2.3 there will be a new construct called "athome" that will allow you to initialize a local at a remote place by going back to the original place. On Thu, May 5, 2011 at 11:45 PM, Jeeva Paudel <je...@ualberta.ca> wrote: > Hi all, > > This is in reference to the Fibonacci example available at > http://dist.codehaus.org/x10/applications/samples/Fib.x10 > > Although async at != at async always, but shouldn't the following two > versions of async produce similar effect? > > at (here) async { f1 = fib(n-1); } must start a new activity located > here and executing S > > async at (here) {fi = fib(n-1); } must also start a new activity > here and execute S here as well. > > Aren't both the same and should compile correctly when the program > compiles correctly with async { f1 = fib(n-1)} ? However, the compiler > reports this error : "f1" may not have been initialized > > > Thanks, > Jeeva P. > > > ------------------------------------------------------------------------------ > WhatsUp Gold - Download Free Network Management Software > The most intuitive, comprehensive, and cost-effective network > management toolset available today. Delivers lowest initial > acquisition cost and overall TCO of any competing solution. > http://p.sf.net/sfu/whatsupgold-sd > _______________________________________________ > X10-users mailing list > X10-users@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/x10-users > ------------------------------------------------------------------------------ WhatsUp Gold - Download Free Network Management Software The most intuitive, comprehensive, and cost-effective network management toolset available today. Delivers lowest initial acquisition cost and overall TCO of any competing solution. http://p.sf.net/sfu/whatsupgold-sd _______________________________________________ X10-users mailing list X10-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/x10-users