From 4abfb2534a8526accba664898a849b85ba8d3ddb Mon Sep 17 00:00:00 2001 From: Nikolay Lunyak Date: Mon, 26 Feb 2024 17:47:49 +0200 Subject: [PATCH] [FIR] Add the `Int? === null` test example ^KT-62646 --- .../testsWithStdLib/equalityCompatibilityCommonCases.fir.kt | 5 +++++ .../testsWithStdLib/equalityCompatibilityCommonCases.kt | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/compiler/testData/diagnostics/testsWithStdLib/equalityCompatibilityCommonCases.fir.kt b/compiler/testData/diagnostics/testsWithStdLib/equalityCompatibilityCommonCases.fir.kt index 5612209d2a5..748ff683e96 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/equalityCompatibilityCommonCases.fir.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/equalityCompatibilityCommonCases.fir.kt @@ -85,6 +85,11 @@ fun incompatibleIdentityRegardlessNullabilitySmartCast(a: Any?, b: Any?) { } } +fun incompatibleIdentityRegardlessNullabilityWithNull(a: Int?) { + a == null + a === null +} + fun incompatibleIdentityRegardlessNullabilityWithValueClasses(c: C?, d: D?) { c == d c === d diff --git a/compiler/testData/diagnostics/testsWithStdLib/equalityCompatibilityCommonCases.kt b/compiler/testData/diagnostics/testsWithStdLib/equalityCompatibilityCommonCases.kt index 5f66804507e..597b2552121 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/equalityCompatibilityCommonCases.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/equalityCompatibilityCommonCases.kt @@ -85,6 +85,11 @@ fun incompatibleIdentityRegardlessNullabilitySmartCast(a: Any?, b: Any?) { } } +fun incompatibleIdentityRegardlessNullabilityWithNull(a: Int?) { + a == null + a === null +} + fun incompatibleIdentityRegardlessNullabilityWithValueClasses(c: C?, d: D?) { c == d c === d