From 78fc87ffb19b6dd77de49ddc851d8bc2360b8ec4 Mon Sep 17 00:00:00 2001 From: Mikhail Glukhikh Date: Tue, 13 Apr 2021 13:57:45 +0300 Subject: [PATCH] FIR: apply minor test data fixes around type mismatch problems --- compiler/fir/analysis-tests/testData/resolve/treeSet.fir.txt | 2 +- compiler/fir/analysis-tests/testData/resolve/treeSet.kt | 4 +++- .../contracts/fromSource/good/returnsImplies/eqNotEq.fir.txt | 2 +- .../contracts/fromSource/good/returnsImplies/eqNotEq.kt | 4 ++-- .../fromSource/good/returnsImplies/typePredicate.fir.txt | 2 +- .../contracts/fromSource/good/returnsImplies/typePredicate.kt | 4 ++-- 6 files changed, 10 insertions(+), 8 deletions(-) diff --git a/compiler/fir/analysis-tests/testData/resolve/treeSet.fir.txt b/compiler/fir/analysis-tests/testData/resolve/treeSet.fir.txt index b01529b47fd..7aba21acd12 100644 --- a/compiler/fir/analysis-tests/testData/resolve/treeSet.fir.txt +++ b/compiler/fir/analysis-tests/testData/resolve/treeSet.fir.txt @@ -1,3 +1,3 @@ FILE: treeSet.kt - public final val x: R|java/util/SortedSet| = R|java/util/TreeSet.TreeSet|() + public final val x: R|java/util/SortedSet| = R|java/util/TreeSet.TreeSet||>() public get(): R|java/util/SortedSet| diff --git a/compiler/fir/analysis-tests/testData/resolve/treeSet.kt b/compiler/fir/analysis-tests/testData/resolve/treeSet.kt index 6529230f09b..b9f5e0591e4 100644 --- a/compiler/fir/analysis-tests/testData/resolve/treeSet.kt +++ b/compiler/fir/analysis-tests/testData/resolve/treeSet.kt @@ -1,3 +1,5 @@ +// FULL_JDK + import java.util.* -val x: SortedSet = TreeSet() +val x: SortedSet = TreeSet() diff --git a/compiler/fir/analysis-tests/testData/resolveWithStdlib/contracts/fromSource/good/returnsImplies/eqNotEq.fir.txt b/compiler/fir/analysis-tests/testData/resolveWithStdlib/contracts/fromSource/good/returnsImplies/eqNotEq.fir.txt index fee93e2b06d..2b5157f85d7 100644 --- a/compiler/fir/analysis-tests/testData/resolveWithStdlib/contracts/fromSource/good/returnsImplies/eqNotEq.fir.txt +++ b/compiler/fir/analysis-tests/testData/resolveWithStdlib/contracts/fromSource/good/returnsImplies/eqNotEq.fir.txt @@ -1,5 +1,5 @@ FILE: eqNotEq.kt - public final fun checkNotNull(x: R|kotlin/Any?|): R|kotlin/Unit| + public final fun checkNotNull(x: R|kotlin/Any?|): R|kotlin/Boolean| [R|Contract description] < Returns(TRUE) -> x != null diff --git a/compiler/fir/analysis-tests/testData/resolveWithStdlib/contracts/fromSource/good/returnsImplies/eqNotEq.kt b/compiler/fir/analysis-tests/testData/resolveWithStdlib/contracts/fromSource/good/returnsImplies/eqNotEq.kt index 2e81aa6712d..f9af2c7d18d 100644 --- a/compiler/fir/analysis-tests/testData/resolveWithStdlib/contracts/fromSource/good/returnsImplies/eqNotEq.kt +++ b/compiler/fir/analysis-tests/testData/resolveWithStdlib/contracts/fromSource/good/returnsImplies/eqNotEq.kt @@ -1,11 +1,11 @@ import kotlin.contracts.* -fun checkNotNull(x: Any?) { +fun checkNotNull(x: Any?): Boolean { contract { returns(true) implies (x != null) returns(false) implies (x == null) } - return x != null + return x != null } fun trickyRequireNotNull(x: Any?) { diff --git a/compiler/fir/analysis-tests/testData/resolveWithStdlib/contracts/fromSource/good/returnsImplies/typePredicate.fir.txt b/compiler/fir/analysis-tests/testData/resolveWithStdlib/contracts/fromSource/good/returnsImplies/typePredicate.fir.txt index 02ead41e79a..938fde1e804 100644 --- a/compiler/fir/analysis-tests/testData/resolveWithStdlib/contracts/fromSource/good/returnsImplies/typePredicate.fir.txt +++ b/compiler/fir/analysis-tests/testData/resolveWithStdlib/contracts/fromSource/good/returnsImplies/typePredicate.fir.txt @@ -1,5 +1,5 @@ FILE: typePredicate.kt - public final fun checkIsString(x: R|kotlin/Any|): R|kotlin/Unit| + public final fun checkIsString(x: R|kotlin/Any|): R|kotlin/Boolean| [R|Contract description] < Returns(TRUE) -> x is kotlin/String diff --git a/compiler/fir/analysis-tests/testData/resolveWithStdlib/contracts/fromSource/good/returnsImplies/typePredicate.kt b/compiler/fir/analysis-tests/testData/resolveWithStdlib/contracts/fromSource/good/returnsImplies/typePredicate.kt index ae92d5b2f23..5c222089784 100644 --- a/compiler/fir/analysis-tests/testData/resolveWithStdlib/contracts/fromSource/good/returnsImplies/typePredicate.kt +++ b/compiler/fir/analysis-tests/testData/resolveWithStdlib/contracts/fromSource/good/returnsImplies/typePredicate.kt @@ -1,11 +1,11 @@ import kotlin.contracts.* -fun checkIsString(x: Any) { +fun checkIsString(x: Any): Boolean { contract { returns(true) implies (x is String) returns(false) implies (x !is String) } - return x is String + return x is String } fun test(x: Any) {