Chapel 1.17.1 newbie question (my real effort is much more complicated, but this illustrates the issue):

   record A {
      type T = real;
      var val : T;
      proc =(ref lhs: A, rhs : T) : void {
        lhs.val = rhs;
      }
   }

yields:

   assign.chpl:4: warning: The left operand of '=' and '<op>=' should
   have 'ref' intent.

There are a couple work arounds:

1) put the "proc =" outside the record (but then the T type is no longer visible).

2) 1+ move "type T" outside the "record" (though it really doesn't otherwise need that wider visibility).

I've run into this in a number of larger cases.  Is there some magic to doing assignment as a member vs.

non-member function?

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Chapel-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/chapel-users

Reply via email to