Details
-
Type:
Bug
-
Status:
Closed
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: X10 2.2.2.1
-
Fix Version/s: X10 2.2.3
-
Component/s: Managed X10: Compiler Codegen
-
Labels:None
-
Environment:x86, linux
-
Number of attachments :
Description
Consider this code fragment:
public class Set[T]{T haszero} implements Iterable[T] { C /** Return this minus all the elements in this that are not greater than u. */ public def remove(u:Int){T==Int}:Set[Int] { var hasElem:Boolean=false; for (x in this) if (x <= u) { hasElem=true; break;} if (! hasElem) return this; var result:Set[Int]=new Set[Int](); for (x in this) if (x > u) result += x; return result; } }
There is a post-X10 compilation error thrown by javac. It can be fixed by replacing return this with return this as Set[T]. But the user should not have to do this..?
Fixed in r23830.
Support type constraints by erasing type params from return type and local variable types.