Hi guys,
I was wondering if it would be possible to assign annotations to types
and employ an annotation processor in order to detect the situation
below which tries to detect if parametres were passed in wrong order.
public class Hello {
static type Left = Double;
static type Right = Double;
public static def main(Array[String]) {
val left : Left = 2.2;
val right : Right = 2.5;
val o = new Hello();
val pass = o.f(left, right); // compiles OK
val fail = o.f(right, left); // should not compile !!!!!
}
def f(l : Left, r : Right) : Double = { ... }
}
Thanks :)
--
Richard Gomes
M: +44(77)9955-6813
http://tinyurl.com/frgomes
twitter: frgomes
JQuantLib is a library for Quantitative Finance written in Java.
http://www.jquantlib.org/
twitter: jquantlib
------------------------------------------------------------------------------
Centralized Desktop Delivery: Dell and VMware Reference Architecture
Simplifying enterprise desktop deployment and management using
Dell EqualLogic storage and VMware View: A highly scalable, end-to-end
client virtualization framework. Read more!
http://p.sf.net/sfu/dell-eql-dev2dev
_______________________________________________
X10-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/x10-users