Hello x10 Team,

I'm using x10 2.0.4 with the IDE Eclipse.
I'm realy confused why I get erros for following code:

#1      public def func(){
#2              shared var arr :Array[Double](101, 0..100);
#3      finish foreach ((i) in 0..100){
#4              var x: Double = i * 2.0;
#5      arr(i) = x;
#6      arr.set(x, i);
#7      }
#8      }

for line #5 I get the error:
"Cannot assign expression to array element of given type. Expression: x 
Type: x10.lang.Double Array
  element: arr(i) Type: x10.lang.Double"

and for line #6 the error:
"Multiple messages at this line.
        - Method set(v: x10.lang.Double, i0: 
x10.lang.Int){x10.array.Array#this.region.rank==1}[]
         in x10.array.Array[x10.lang.Double] cannot be called with arguments 
(x10.lang.Double, x10.lang.Int
         {self==i}); Call invalid; calling environment does not entail the 
method guard.
        - Method set(v: x10.lang.Double, i0: 
x10.lang.Int){x10.array.Array#this.region.rank==1}[]
         in x10.array.Array[x10.lang.Double] cannot be called with arguments 
(x10.lang.Double, x10.lang.Int
         {self==i}); Call invalid; calling environment does not entail the 
method guard."

What I read in the errors above is that both types are equal so I don't 
get why this does not work.

#5 and #6 should to exactly the same. The idea behind this code is to 
create an array and save each value in this array to create the sum of 
all calculations at the end (sum not included in this snippet).
My Problem is how can I access an array? Or what am I doing wrong here 
in line #5 and #6 when I try to store a value in the array?


Best regards,
Ralf Schelkle

------------------------------------------------------------------------------
ThinkGeek and WIRED's GeekDad team up for the Ultimate 
GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the 
lucky parental unit.  See the prize list and enter to win: 
http://p.sf.net/sfu/thinkgeek-promo
_______________________________________________
X10-users mailing list
X10-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/x10-users

Reply via email to