Christoph Pospiech <christoph.pospi...@de.ibm.com> wrote on 06/01/2010
06:05:20 AM:
>
> the following should be trivial, but I am stuck at an error message. Can
> someone please fill me in ?
>
> Here is the code snippet.
>
>    static type ArrayD = Array[double]{rank==1};
>
>    global def ArrayD_add(s1:ArrayD, s2:ArrayD)
>       {s2.region() == s1.region()}: ArrayD {
>          s1.lift(s1, s2, Double.+);
>          return(s1);
>    }
>

I would try it first avoiding the use of the typedef ArrayD.  We sometimes
have problems with typedefs not always working the same way as the code
would have worked without the typedef.

And Yoav's point about ! (or DynamicCalls) is right as well.  The methods
of Array are not global, so you either need to declare them as ArrayD! or
let the compiler inject the casts to ArrayD! for you.  I'd suspect without
any proof that what you may be seeing is that the compiler injection of
place-type casts interacts poorly with typedefs.

Would be interesting to see what variations on this code work/don't work.

--dave
------------------------------------------------------------------------------

_______________________________________________
X10-users mailing list
X10-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/x10-users

Reply via email to