From 395c0f12b158613cca1dc357a2c627448f482ef4 Mon Sep 17 00:00:00 2001 From: Alexander Udalov Date: Tue, 27 Oct 2015 23:31:29 +0300 Subject: [PATCH] Fix confusing behavior in test when assertion fails --- .../delegatedProperty/stackOverflowOnCallFromGetValue.kt | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/compiler/testData/codegen/boxWithStdlib/delegatedProperty/stackOverflowOnCallFromGetValue.kt b/compiler/testData/codegen/boxWithStdlib/delegatedProperty/stackOverflowOnCallFromGetValue.kt index 004930da42f..83e85fc4015 100644 --- a/compiler/testData/codegen/boxWithStdlib/delegatedProperty/stackOverflowOnCallFromGetValue.kt +++ b/compiler/testData/codegen/boxWithStdlib/delegatedProperty/stackOverflowOnCallFromGetValue.kt @@ -27,14 +27,15 @@ object O { fun check(lambda: () -> Unit) { try { lambda() - throw AssertionError("Getting the property value with .get() from getValue() or setting it with .set() in setValue() " + - "is effectively an endless recursion and should fail") } catch (e: Throwable) { if (e !is InvocationTargetException && e !is StackOverflowError) { throw AssertionError("The current implementation uses reflection to get the value of the property," + "so either InvocationTargetException or StackOverflowError should have happened, but was: ${e}") } + return } + throw AssertionError("Getting the property value with .get() from getValue() or setting it with .set() in setValue() " + + "is effectively an endless recursion and should fail") } fun box(): String {