diff --git a/compiler/testData/codegen/box/defaultArguments/function/abstractClass.kt b/compiler/testData/codegen/box/defaultArguments/function/abstractClass.kt new file mode 100644 index 00000000000..c1cc5d0bd9e --- /dev/null +++ b/compiler/testData/codegen/box/defaultArguments/function/abstractClass.kt @@ -0,0 +1,16 @@ +abstract class Base { + abstract fun foo(a: String = "abc"): String +} + +class Derived: Base() { + override fun foo(a: String): String { + return a + } +} + +fun box(): String { + val result = Derived().foo() + if (result != "abc") return "Fail: $result" + + return "OK" +} \ No newline at end of file diff --git a/compiler/testData/codegen/box/defaultArguments/function/trait.kt b/compiler/testData/codegen/box/defaultArguments/function/trait.kt new file mode 100644 index 00000000000..b986362f653 --- /dev/null +++ b/compiler/testData/codegen/box/defaultArguments/function/trait.kt @@ -0,0 +1,14 @@ +trait Base { + fun bar(a: String = "abc"): String = a + " from trait" +} + +class Derived: Base { + override fun bar(a: String): String = a + " from class" +} + +fun box(): String { + val result = Derived().bar() + if (result != "abc from class") return "Fail: $result" + + return "OK" +} \ No newline at end of file diff --git a/compiler/testData/compileJavaAgainstKotlin/method/throws/GenericSubstitution.java b/compiler/testData/compileJavaAgainstKotlin/method/throws/GenericSubstitution.java new file mode 100644 index 00000000000..d32812f672c --- /dev/null +++ b/compiler/testData/compileJavaAgainstKotlin/method/throws/GenericSubstitution.java @@ -0,0 +1,8 @@ +class JavaClass { + public static void main(String[] args) { + try { + new Derived().one(null); + } + catch (E1 e) {} + } +} \ No newline at end of file diff --git a/compiler/testData/compileJavaAgainstKotlin/method/throws/GenericSubstitution.kt b/compiler/testData/compileJavaAgainstKotlin/method/throws/GenericSubstitution.kt new file mode 100644 index 00000000000..0e6b6994dc0 --- /dev/null +++ b/compiler/testData/compileJavaAgainstKotlin/method/throws/GenericSubstitution.kt @@ -0,0 +1,8 @@ +class E1: Exception() + +trait Base { + throws(javaClass()) + fun one(t: T) {} +} + +class Derived: Base \ No newline at end of file diff --git a/compiler/tests/org/jetbrains/jet/codegen/generated/BlackBoxCodegenTestGenerated.java b/compiler/tests/org/jetbrains/jet/codegen/generated/BlackBoxCodegenTestGenerated.java index 68b9b5951c3..dc81c5dd5ad 100644 --- a/compiler/tests/org/jetbrains/jet/codegen/generated/BlackBoxCodegenTestGenerated.java +++ b/compiler/tests/org/jetbrains/jet/codegen/generated/BlackBoxCodegenTestGenerated.java @@ -1929,6 +1929,11 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest { @TestMetadata("compiler/testData/codegen/box/defaultArguments/function") public static class Function extends AbstractBlackBoxCodegenTest { + @TestMetadata("abstractClass.kt") + public void testAbstractClass() throws Exception { + doTest("compiler/testData/codegen/box/defaultArguments/function/abstractClass.kt"); + } + public void testAllFilesPresentInFunction() throws Exception { JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), "org.jetbrains.jet.generators.tests.TestsPackage", new File("compiler/testData/codegen/box/defaultArguments/function"), Pattern.compile("^(.+)\\.kt$"), true); } @@ -2013,6 +2018,11 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest { doTest("compiler/testData/codegen/box/defaultArguments/function/mixingNamedAndPositioned.kt"); } + @TestMetadata("trait.kt") + public void testTrait() throws Exception { + doTest("compiler/testData/codegen/box/defaultArguments/function/trait.kt"); + } + } public static Test innerSuite() { diff --git a/compiler/tests/org/jetbrains/jet/jvm/compiler/CompileJavaAgainstKotlinTestGenerated.java b/compiler/tests/org/jetbrains/jet/jvm/compiler/CompileJavaAgainstKotlinTestGenerated.java index 8f3bedb8726..cd10e6ddce7 100644 --- a/compiler/tests/org/jetbrains/jet/jvm/compiler/CompileJavaAgainstKotlinTestGenerated.java +++ b/compiler/tests/org/jetbrains/jet/jvm/compiler/CompileJavaAgainstKotlinTestGenerated.java @@ -286,6 +286,11 @@ public class CompileJavaAgainstKotlinTestGenerated extends AbstractCompileJavaAg doTest("compiler/testData/compileJavaAgainstKotlin/method/throws/Delegation.kt"); } + @TestMetadata("GenericSubstitution.kt") + public void testGenericSubstitution() throws Exception { + doTest("compiler/testData/compileJavaAgainstKotlin/method/throws/GenericSubstitution.kt"); + } + @TestMetadata("TopLevel.kt") public void testTopLevel() throws Exception { doTest("compiler/testData/compileJavaAgainstKotlin/method/throws/TopLevel.kt");