Casting doesn't seem to interact with type inference in the way I'd
expect it to. I am allowed to write this:

public class Foo { val i = new Cell(5); }

However, this is probably not what I want, though, because the type of
i is Cell[Int{self==5}], not Cell[Int]. This, on the other hand, does
what I expect (defining a static type IntCell = Cell[Int] also works).

public class Foo { val i = new Cell[Int](5); }

What confuses me is that I'm also unable to cast an Int{self == 5} to
an Int to get the same result:

// Same as the first example, not the second; i has type Cell[Int{self==5}].
public class Foo { val i = new Cell(5 as Int); }

Is this a bug, or is this the expected behavior for a reason I do not
understand?

-- 
Robert J. Simmons
simrob.com
gps.simrob.com
rjsim...@cs.cmu.edu
robsimm...@gmail.com
Cell: 404-273-6890

------------------------------------------------------------------------------
The ultimate all-in-one performance toolkit: Intel(R) Parallel Studio XE:
Pinpoint memory and threading errors before they happen.
Find and fix more than 250 security defects in the development cycle.
Locate bottlenecks in serial and parallel code that limit performance.
http://p.sf.net/sfu/intel-dev2devfeb
_______________________________________________
X10-users mailing list
X10-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/x10-users

Reply via email to