Yes, it's an inference bug. Igor recently added the restriction that "this" cannot appear in the constraint of the ctor (arguments or return type). And the inference infered this type: C:\cygwin\home\Yoav\test\Hello.x10:8-12: This or super cannot be used (implicitly or explicitly) in a constructor return type. Type: Counts{self.dim==dimension, self.pos.home==here, * self.pos.length==Counts#this.dim*, self.neg.home==here, self.neg.length==Counts#this.dim} 1 error.
I already opened a jira on it: http://jira.codehaus.org/browse/XTENLANG-1770 The work around should be to explicitly write the return type (which is a good habit anyway! I was just talking to Ben about it today. It is a good habit to always write the return type of methods. Inference of return type should be disabled in my opinion, since it causes other problems, like in overriding where the return type must be preserved.) But even that still fails. So, I removed this check on the return type, until the inference bug is fixed. Please update to SVN head. 2010/9/2 Yan CRL Li <liyan...@cn.ibm.com> > > My code piece : > > public struct Counts(dim:Int, pos: ValRail[ValHashMap[String,Int]](dim), > neg:ValRail[ValHashMap[String,Int]](dim)) { > static type Data = ValHashMap[String,Int]; > public def this (dimension : Int ) { > property(dimension, > ValRail.make[Data](dim, (i:Int) => ValHashMap.make > [String,Int](new HashMap[String,Int]())), > ValRail.make[Data](dim, (i:Int) => ValHashMap.make > [String,Int](new HashMap[String,Int]()))); > } > } > Compile error : > This or super cannot be used (implicitly or explicitly) in a constructor > return type. > > This code can be compiled correctly before tag 15544. Current version > compiles wrong. > > Can anyone give me any hint ? Thanks > > Li Yan (李严) > > System Group, IBM China Research Lab > Tel: 8610-58748060 > Tieline: 11905-8060 > Add: Building 19 Zhongguancun Software Park, 8 Dongbeiwang WestRoad, > Haidian District, Beijing, 100094, P.R.China > E-mail: liyan...@cn.ibm.com > > ------------------------------------------------------------------------------ > This SF.net Dev2Dev email is sponsored by: > > Show off your parallel programming skills. > Enter the Intel(R) Threading Challenge 2010. > http://p.sf.net/sfu/intel-thread-sfd > _______________________________________________ > X10-users mailing list > X10-users@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/x10-users > ------------------------------------------------------------------------------ This SF.net Dev2Dev email is sponsored by: Show off your parallel programming skills. Enter the Intel(R) Threading Challenge 2010. http://p.sf.net/sfu/intel-thread-sfd _______________________________________________ X10-users mailing list X10-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/x10-users