added test cases to try reproduce yesterdays JS bug with missing "this.drop(1)" in List.tail property, found another JS compile issue...

This commit is contained in:
James Strachan
2012-07-03 08:45:26 +01:00
parent d8d1da7334
commit b960bea2d9
3 changed files with 58 additions and 0 deletions
@@ -66,4 +66,12 @@ public final class ExtensionFunctionTest extends SingleFileTranslationTest {
public void testExtensionFunctionCalledFromExtensionFunction() throws Exception {
fooBoxTest();
}
public void testExtensionOnClassWithExplicitAndImplicitReceiver() throws Exception {
fooBoxTest();
}
public void TODO_FIXME_testExtensionPropertyOnClassWithExplicitAndImplicitReceiver() throws Exception {
fooBoxTest();
}
}
@@ -0,0 +1,24 @@
package foo
class Foo {
fun blah(): Int {
return 5
}
}
public inline fun Foo.fooImp() : String {
return "impl" + blah()
}
public inline fun Foo.fooExp() : String {
return "expl" + this.blah()
}
fun box() : Boolean {
var a = Foo()
if (a.fooImp() != "impl5") return false
if (a.fooExp() != "expl5") return false
return true;
}
@@ -0,0 +1,26 @@
package foo
class Foo {
fun blah(): Int {
return 6
}
}
val Foo.fooImp : String
get() {
return "implProp" + blah()
}
val Foo.fooExp() : String
get() {
return "explProp" + this.blah()
}
fun box() : Boolean {
var a = Foo()
if (a.fooImp != "implProp6") return false
if (a.fooExp != "explProp6") return false
return true;
}