jsx/JSX — pull request #86 by wasabiz (2012-11-11 18:26:53+00:00)
Title: Enhanced type inference of conditional expression

I changed the behavior of conditional expression like below:

```
class A {}
class B extends A {}
class C extends A {}

interface I {}
class X implements I {}
class Y implements I {}
class Z extends Y {}

class _Main {
static function main(args : string[]) : void {
var variant_value = 123 as variant;

var a = (true)? 1 : 1.0; // number
var b = (true)? "asdf" : [ "a", "b"][0]; // Nullable.
var c = (true)? variant_value : 1;	// variant
var d = (true)? new A : new B;	// A
var e = (true)? new A : null;	// A
var f = (true)? 1 : null;	// Nullable.
var g = (true)? "a" : null;	// Nullable.
var h = (true)? new B : new C;	// A
var i = (true)? new X : new Y;	// I
var j = (true)? new X : new Z;	// I
var k = (true)? new A : new X;	// Object

// for now avoids returning variant type as a join of a primitive and an object.
// var l = (true)? 1 : new A;	// error

var m = (true)? function (a : A) : X { return new X; } : function (a : A) : X { return new X; }; // (A) -> X

// calculation of the joins of function types is not supported (for now)
// var n = (true)? function (a : A) : Y { return new Y; } : function (b : B) : X { return new X; }; // (B) -> X
}
}
```