Details
-
Type:
Improvement
-
Status:
Open
-
Priority:
Major
-
Resolution: Unresolved
-
Affects Version/s: X10 2.0.0
-
Fix Version/s: X10 2.4
-
Component/s: Language Design
-
Labels:None
-
Number of attachments :
Description
Bard and Igor, in an email discussion, concluded that they'd like to be able to interrogate the run-time types of objects in constraints (since run-time types are pretty much properties). For example, the following Metabox class is like a boxed object, except that, if the object is an iterator, the metabox gives access to the iterator too.
This example predictably doesn't even parse currently.
class Metabox[T] {
val x : T;
def this(x:T){this.x = x;}
def iter[U] (){x.type <: Iterator[U]} : Iterator[U] = (x as Iterator[U]);
}
Issue Links
- relates to
-
XTENLANG-2455
Category predicates (isClass, isStruct, isFunction) needed in System.
-
Why not just say:
class Metabox[T] { val x : T; def this(x:T){this.x = x;} def iter[U] (){T <: Iterator[U]} : Iterator[U] = (x as Iterator[U]); }