From a3ac4506af257f86e58f09b63b2084a2ec53dc7a Mon Sep 17 00:00:00 2001 From: Alex Tkachman Date: Sat, 12 Nov 2011 20:51:19 +0200 Subject: [PATCH] failing test for kt-475 --- compiler/testData/codegen/regressions/kt475.jet | 14 ++++++++++++++ .../jet/codegen/ExtensionFunctionsTest.java | 4 ++++ 2 files changed, 18 insertions(+) create mode 100644 compiler/testData/codegen/regressions/kt475.jet diff --git a/compiler/testData/codegen/regressions/kt475.jet b/compiler/testData/codegen/regressions/kt475.jet new file mode 100644 index 00000000000..07912642f3e --- /dev/null +++ b/compiler/testData/codegen/regressions/kt475.jet @@ -0,0 +1,14 @@ +import java.math.BigDecimal + +fun box() : String { + // Easy to make BigDecimals user-friendly + System.out?.println( + "2.00".bd - "1.00" + ) + return "OK" +} + +val String.bd = BigDecimal(this) + +fun BigDecimal.minus(other : BigDecimal) = this.subtract(other) +fun BigDecimal.minus(other : String) = subtract(other.bd) // this can be omitted diff --git a/compiler/tests/org/jetbrains/jet/codegen/ExtensionFunctionsTest.java b/compiler/tests/org/jetbrains/jet/codegen/ExtensionFunctionsTest.java index 16487d292f1..d0a9fa5f5c9 100644 --- a/compiler/tests/org/jetbrains/jet/codegen/ExtensionFunctionsTest.java +++ b/compiler/tests/org/jetbrains/jet/codegen/ExtensionFunctionsTest.java @@ -32,4 +32,8 @@ public class ExtensionFunctionsTest extends CodegenTestCase { public void testVirtual() throws Exception { blackBoxFile("extensionFunctions/virtual.jet"); } + + public void testKt475() throws Exception { + blackBoxFile("regressions/kt475.jet"); + } }