Merge remote branch 'origin/master'

This commit is contained in:
Andrey Breslav
2011-11-07 19:17:07 +03:00
3 changed files with 11 additions and 1 deletions
@@ -18,7 +18,7 @@ public class Concat implements IntrinsicMethod {
codegen.generateStringBuilderConstructor(); codegen.generateStringBuilderConstructor();
if (receiver == null) { // LHS.plus(RHS) if (receiver == null) { // LHS.plus(RHS)
v.swap(); // StringBuilder LHS v.swap(); // StringBuilder LHS
codegen.invokeAppendMethod(codegen.expressionType(arguments.get(0))); // StringBuilder(LHS) codegen.invokeAppendMethod(expectedType); // StringBuilder(LHS)
codegen.invokeAppend(arguments.get(0)); codegen.invokeAppend(arguments.get(0));
} }
else { // LHS + RHS else { // LHS + RHS
@@ -0,0 +1,5 @@
fun box(): String {
var s = "s"
s += 1
return if (s == "s1") "OK" else "fail"
}
@@ -4,6 +4,7 @@ import java.lang.reflect.Method;
/** /**
* @author yole * @author yole
* @author alex.tkachman
*/ */
public class PrimitiveTypesTest extends CodegenTestCase { public class PrimitiveTypesTest extends CodegenTestCase {
public void testPlus() throws Exception { public void testPlus() throws Exception {
@@ -274,4 +275,8 @@ public class PrimitiveTypesTest extends CodegenTestCase {
public void testKt248 () throws Exception { public void testKt248 () throws Exception {
blackBoxFile("regressions/kt248.jet"); blackBoxFile("regressions/kt248.jet");
} }
public void testKt446 () throws Exception {
blackBoxFile("regressions/kt446.jet");
}
} }