From 33c04bde9a9972d912f608d8cc6e9bb81b4ac6dd Mon Sep 17 00:00:00 2001 From: Svetlana Isakova Date: Mon, 9 Dec 2013 17:10:22 +0400 Subject: [PATCH] changed tests where autocasts aren't needed but are reported due to KT-4294 --- .../tests/nullabilityAndAutoCasts/AssertNotNull.kt | 7 ++++--- .../tests/smartCasts/inference/intersectionTypes.kt | 7 ++++--- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/compiler/testData/diagnostics/tests/nullabilityAndAutoCasts/AssertNotNull.kt b/compiler/testData/diagnostics/tests/nullabilityAndAutoCasts/AssertNotNull.kt index fa400ab5851..974be0bbaf1 100644 --- a/compiler/testData/diagnostics/tests/nullabilityAndAutoCasts/AssertNotNull.kt +++ b/compiler/testData/diagnostics/tests/nullabilityAndAutoCasts/AssertNotNull.kt @@ -17,16 +17,17 @@ fun main(args : Array) { d!! } + // auto cast isn't needed, but is reported due to KT-4294 if (d is String) { - d!! + d!! } if (d is String?) { if (d != null) { - d!! + d!! } if (d is String) { - d!! + d!! } } diff --git a/compiler/testData/diagnostics/tests/smartCasts/inference/intersectionTypes.kt b/compiler/testData/diagnostics/tests/smartCasts/inference/intersectionTypes.kt index 231a749091e..df27aae4f3a 100644 --- a/compiler/testData/diagnostics/tests/smartCasts/inference/intersectionTypes.kt +++ b/compiler/testData/diagnostics/tests/smartCasts/inference/intersectionTypes.kt @@ -12,15 +12,16 @@ trait C: A fun test(a: A, b: B, c: C) { if (a is B && a is C) { - val d: C = id(a) + val d: C = id(a) val e: Any = id(a) val f = id(a) f: A - val g = two(a, b) + val g = two(a, b) g: B g: A - val h: Any = two(a, b) + // auto cast isn't needed, but is reported due to KT-4294 + val h: Any = two(a, b) val k = three(a, b, c) k: A