ceylon/ceylon-ide-eclipse — pull request #319 by sjurba (2012-07-12 22:40:41+00:00)
Title: Improved #285 with extracting temp variable for all but BaseMemberExpressions

Added some more alternatives for happy testing..

String? hi() {
Integer i = 1;
Boolean test = true;
String x = "x";
String y = "y";
String? obj = null;
String default = "";
Process process = Process();
//String first = "f";

if (i == 0) {
return test then x else y;
} else if (i == 1) {
return test then x;
} else if (i == 2) {
return obj else default;
} else if (i == 3) {
return process.first() else default;
}

Object o = test then x else y;
Object? o1 = test then default;
Object o2 = obj else default;
Object o3 = process.first() else default;
Object o3_1 = process.firstAttr else default;

value o4= test then x else y;
value o5 = test then default;
value o6 = obj else default;
value o7 = process.first() else default;

variable Object v := test then x else y;
variable String? v1 := test then default;
variable Object v2 := obj else default;
variable Object v3 := process.first() else default;

variable value v4 := test then x else y;
variable value v5 := test then default;
variable value v6 := obj else default;
variable value v7 := process.first() else default;

v := test then x else y;
v1 := test then default;
v2 := obj else default;
v3 := process.first() else default;
v4 := obj else default;

//return obj else (test then x else y);

//return (v1 := "") else "";

return null;
}