From 7b49baf8c358497cf7bb3ca6a1249970898b0743 Mon Sep 17 00:00:00 2001 From: "Pavel V. Talanov" Date: Mon, 28 Sep 2015 19:22:41 +0300 Subject: [PATCH] Test data adjustment: JetDiagnosticsTest --- .../return/IfInReturnedExpression.kt | 8 +++++-- .../return/IfInReturnedExpression.txt | 22 ++++++++++++++++++- .../tests/inference/dependOnExpectedType.kt | 4 ++-- .../numbers/numbersInSimpleConstraints.kt | 4 ++-- 4 files changed, 31 insertions(+), 7 deletions(-) diff --git a/compiler/testData/diagnostics/tests/functionLiterals/return/IfInReturnedExpression.kt b/compiler/testData/diagnostics/tests/functionLiterals/return/IfInReturnedExpression.kt index 516d7415f46..05cd4632d05 100644 --- a/compiler/testData/diagnostics/tests/functionLiterals/return/IfInReturnedExpression.kt +++ b/compiler/testData/diagnostics/tests/functionLiterals/return/IfInReturnedExpression.kt @@ -1,5 +1,9 @@ val flag = true -val a/*: () -> Comparable*/ = l@ { - return@l if (flag) "OK" else 4 +interface I +class A(): I +class B(): I + +val a = l@ { + return@l if (flag) A() else B() } \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/functionLiterals/return/IfInReturnedExpression.txt b/compiler/testData/diagnostics/tests/functionLiterals/return/IfInReturnedExpression.txt index f738241d57f..85fd822c456 100644 --- a/compiler/testData/diagnostics/tests/functionLiterals/return/IfInReturnedExpression.txt +++ b/compiler/testData/diagnostics/tests/functionLiterals/return/IfInReturnedExpression.txt @@ -1,4 +1,24 @@ package -public val a: () -> kotlin.Comparable +public val a: () -> I public val flag: kotlin.Boolean = true + +public final class A : I { + public constructor A() + public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean + public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int + public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String +} + +public final class B : I { + public constructor B() + public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean + public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int + public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String +} + +public interface I { + public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean + public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int + public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String +} diff --git a/compiler/testData/diagnostics/tests/inference/dependOnExpectedType.kt b/compiler/testData/diagnostics/tests/inference/dependOnExpectedType.kt index 623df7913b3..59ddbc81b7a 100644 --- a/compiler/testData/diagnostics/tests/inference/dependOnExpectedType.kt +++ b/compiler/testData/diagnostics/tests/inference/dependOnExpectedType.kt @@ -38,8 +38,8 @@ fun test1() { val i = both(1, "") val j = both(id(1), id("")) - checkSubtype>(i) - checkSubtype>(j) + checkSubtype(i) + checkSubtype(j) } fun list(value: T) : ArrayList { diff --git a/compiler/testData/diagnostics/tests/numbers/numbersInSimpleConstraints.kt b/compiler/testData/diagnostics/tests/numbers/numbersInSimpleConstraints.kt index 7831173206c..24bbfefba0c 100644 --- a/compiler/testData/diagnostics/tests/numbers/numbersInSimpleConstraints.kt +++ b/compiler/testData/diagnostics/tests/numbers/numbersInSimpleConstraints.kt @@ -31,7 +31,7 @@ fun test() { otherGeneric(1) val r = either(1, "") - r checkType { _>() } + r checkType { _() } use(a, b, c, d, e, f, g, r) } @@ -56,7 +56,7 @@ fun lowerBound(t: T, l : Cov): T = throw Exception("$t $l") fun testLowerBound(cov: Cov, covN: Cov) { val r = lowerBound(1, cov) - r checkType { _>() } + r checkType { _() } val n = lowerBound(1, covN) n checkType { _() }