FIR DFA: smartcast variable to Nothing? on null assignment
In order to make resolution still work for members not available from `Nothing`, we track the type without `Nothing?` and use that for resolution instead.
This commit is contained in:
committed by
teamcityserver
parent
7e2f15f532
commit
4726dcce40
+40
-37
@@ -702,44 +702,45 @@ digraph boundSmartcastsInBranches_kt {
|
||||
293 [label="Access variable R|<local>/x|"];
|
||||
294 [label="Access variable <Inapplicable(UNSAFE_CALL): kotlin/String.length>#"];
|
||||
295 [label="Access variable R|<local>/y|"];
|
||||
296 [label="Access variable R|kotlin/String.length|"];
|
||||
297 [label="Access variable R|<local>/z|"];
|
||||
298 [label="Access variable <Inapplicable(UNSAFE_CALL): kotlin/String.length>#"];
|
||||
299 [label="Exit block"];
|
||||
296 [label="Stub" style="filled" fillcolor=gray];
|
||||
297 [label="Access variable R|kotlin/String.length|" style="filled" fillcolor=gray];
|
||||
298 [label="Access variable R|<local>/z|" style="filled" fillcolor=gray];
|
||||
299 [label="Access variable <Inapplicable(UNSAFE_CALL): kotlin/String.length>#" style="filled" fillcolor=gray];
|
||||
300 [label="Exit block" style="filled" fillcolor=gray];
|
||||
}
|
||||
300 [label="Exit when branch result"];
|
||||
301 [label="Exit when"];
|
||||
301 [label="Exit when branch result" style="filled" fillcolor=gray];
|
||||
302 [label="Exit when"];
|
||||
}
|
||||
subgraph cluster_67 {
|
||||
color=blue
|
||||
302 [label="Enter when"];
|
||||
303 [label="Enter when"];
|
||||
subgraph cluster_68 {
|
||||
color=blue
|
||||
303 [label="Enter when branch condition "];
|
||||
304 [label="Access variable R|<local>/z|"];
|
||||
305 [label="Const: Null(null)"];
|
||||
306 [label="Equality operator !="];
|
||||
307 [label="Exit when branch condition"];
|
||||
304 [label="Enter when branch condition "];
|
||||
305 [label="Access variable R|<local>/z|"];
|
||||
306 [label="Const: Null(null)"];
|
||||
307 [label="Equality operator !="];
|
||||
308 [label="Exit when branch condition"];
|
||||
}
|
||||
308 [label="Synthetic else branch"];
|
||||
309 [label="Enter when branch result"];
|
||||
309 [label="Synthetic else branch"];
|
||||
310 [label="Enter when branch result"];
|
||||
subgraph cluster_69 {
|
||||
color=blue
|
||||
310 [label="Enter block"];
|
||||
311 [label="Access variable R|<local>/x|"];
|
||||
312 [label="Access variable R|kotlin/String.length|"];
|
||||
313 [label="Access variable R|<local>/y|"];
|
||||
314 [label="Access variable <Inapplicable(UNSAFE_CALL): kotlin/String.length>#"];
|
||||
315 [label="Access variable R|<local>/z|"];
|
||||
316 [label="Access variable R|kotlin/String.length|"];
|
||||
317 [label="Exit block"];
|
||||
311 [label="Enter block"];
|
||||
312 [label="Access variable R|<local>/x|"];
|
||||
313 [label="Access variable R|kotlin/String.length|"];
|
||||
314 [label="Access variable R|<local>/y|"];
|
||||
315 [label="Access variable <Inapplicable(UNSAFE_CALL): kotlin/String.length>#"];
|
||||
316 [label="Access variable R|<local>/z|"];
|
||||
317 [label="Access variable R|kotlin/String.length|"];
|
||||
318 [label="Exit block"];
|
||||
}
|
||||
318 [label="Exit when branch result"];
|
||||
319 [label="Exit when"];
|
||||
319 [label="Exit when branch result"];
|
||||
320 [label="Exit when"];
|
||||
}
|
||||
320 [label="Exit block"];
|
||||
321 [label="Exit block"];
|
||||
}
|
||||
321 [label="Exit function test_7" style="filled" fillcolor=red];
|
||||
322 [label="Exit function test_7" style="filled" fillcolor=red];
|
||||
}
|
||||
202 -> {203};
|
||||
203 -> {204};
|
||||
@@ -829,26 +830,27 @@ digraph boundSmartcastsInBranches_kt {
|
||||
287 -> {288};
|
||||
288 -> {289};
|
||||
289 -> {291 290};
|
||||
290 -> {301};
|
||||
290 -> {302};
|
||||
291 -> {292};
|
||||
292 -> {293};
|
||||
293 -> {294};
|
||||
294 -> {295};
|
||||
295 -> {296};
|
||||
296 -> {297};
|
||||
297 -> {298};
|
||||
298 -> {299};
|
||||
299 -> {300};
|
||||
300 -> {301};
|
||||
301 -> {302};
|
||||
295 -> {322} [label=onUncaughtException];
|
||||
295 -> {296} [style=dotted];
|
||||
296 -> {297} [style=dotted];
|
||||
297 -> {298} [style=dotted];
|
||||
298 -> {299} [style=dotted];
|
||||
299 -> {300} [style=dotted];
|
||||
300 -> {301} [style=dotted];
|
||||
301 -> {302} [style=dotted];
|
||||
302 -> {303};
|
||||
303 -> {304};
|
||||
304 -> {305};
|
||||
305 -> {306};
|
||||
306 -> {307};
|
||||
307 -> {309 308};
|
||||
308 -> {319};
|
||||
309 -> {310};
|
||||
307 -> {308};
|
||||
308 -> {310 309};
|
||||
309 -> {320};
|
||||
310 -> {311};
|
||||
311 -> {312};
|
||||
312 -> {313};
|
||||
@@ -860,5 +862,6 @@ digraph boundSmartcastsInBranches_kt {
|
||||
318 -> {319};
|
||||
319 -> {320};
|
||||
320 -> {321};
|
||||
321 -> {322};
|
||||
|
||||
}
|
||||
|
||||
@@ -32,10 +32,10 @@ import org.jetbrains.kotlin.fir.resolve.inference.isBuiltinFunctionalType
|
||||
import org.jetbrains.kotlin.fir.resolve.providers.getSymbolByTypeRef
|
||||
import org.jetbrains.kotlin.fir.resolve.transformers.body.resolve.resultType
|
||||
import org.jetbrains.kotlin.fir.resolve.transformers.firClassLike
|
||||
import org.jetbrains.kotlin.fir.symbols.ensureResolved
|
||||
import org.jetbrains.kotlin.fir.scopes.impl.delegatedWrapperData
|
||||
import org.jetbrains.kotlin.fir.scopes.impl.importedFromObjectData
|
||||
import org.jetbrains.kotlin.fir.symbols.FirBasedSymbol
|
||||
import org.jetbrains.kotlin.fir.symbols.ensureResolved
|
||||
import org.jetbrains.kotlin.fir.symbols.impl.*
|
||||
import org.jetbrains.kotlin.fir.types.*
|
||||
import org.jetbrains.kotlin.fir.types.builder.buildErrorTypeRef
|
||||
@@ -266,10 +266,21 @@ fun BodyResolveComponents.transformQualifiedAccessUsingSmartcastInfo(
|
||||
} else {
|
||||
SmartcastStability.STABLE_VALUE
|
||||
}
|
||||
|
||||
val originalType = qualifiedAccessExpression.resultType.coneType
|
||||
val allTypes = typesFromSmartCast.also {
|
||||
it += originalType
|
||||
}
|
||||
val intersectedType = ConeTypeIntersector.intersectTypes(session.inferenceComponents.ctx, allTypes)
|
||||
if (intersectedType == originalType) return qualifiedAccessExpression
|
||||
val intersectedTypeRef = buildResolvedTypeRef {
|
||||
source = qualifiedAccessExpression.resultType.source?.fakeElement(FirFakeSourceElementKind.SmartCastedTypeRef)
|
||||
type = intersectedType
|
||||
annotations += qualifiedAccessExpression.resultType.annotations
|
||||
delegatedTypeRef = qualifiedAccessExpression.resultType
|
||||
}
|
||||
// For example, if (x == null) { ... },
|
||||
// we don't want to smartcast to Nothing?, but we want to record the nullability to its own kind of node.
|
||||
// TODO: should we differentiate x == null v.s. x is Nothing?
|
||||
// we need to track the type without `Nothing?` so that resolution with this as receiver can go through properly.
|
||||
if (typesFromSmartCast.any { it.isNullableNothing }) {
|
||||
val typesFromSmartcastWithoutNullableNothing =
|
||||
typesFromSmartCast.filterTo(mutableListOf()) { !it.isNullableNothing }.also {
|
||||
@@ -285,24 +296,13 @@ fun BodyResolveComponents.transformQualifiedAccessUsingSmartcastInfo(
|
||||
}
|
||||
return buildExpressionWithSmartcastToNull {
|
||||
originalExpression = qualifiedAccessExpression
|
||||
// TODO: Use Nothing? during resolution?
|
||||
smartcastType = intersectedTypeRefWithoutNullableNothing
|
||||
// NB: Nothing? in types from smartcast in DFA is recorded here (and the expression kind itself).
|
||||
smartcastType = intersectedTypeRef
|
||||
smartcastTypeWithoutNullableNothing = intersectedTypeRefWithoutNullableNothing
|
||||
this.typesFromSmartCast = typesFromSmartCast
|
||||
this.smartcastStability = smartcastStability
|
||||
}
|
||||
}
|
||||
val allTypes = typesFromSmartCast.also {
|
||||
it += originalType
|
||||
}
|
||||
val intersectedType = ConeTypeIntersector.intersectTypes(session.inferenceComponents.ctx, allTypes)
|
||||
if (intersectedType == originalType) return qualifiedAccessExpression
|
||||
val intersectedTypeRef = buildResolvedTypeRef {
|
||||
source = qualifiedAccessExpression.resultType.source?.fakeElement(FirFakeSourceElementKind.SmartCastedTypeRef)
|
||||
type = intersectedType
|
||||
annotations += qualifiedAccessExpression.resultType.annotations
|
||||
delegatedTypeRef = qualifiedAccessExpression.resultType
|
||||
}
|
||||
|
||||
return buildExpressionWithSmartcast {
|
||||
originalExpression = qualifiedAccessExpression
|
||||
smartcastType = intersectedTypeRef
|
||||
@@ -339,7 +339,13 @@ fun FirAnnotationCall.fqName(session: FirSession): FqName? {
|
||||
}
|
||||
|
||||
fun FirCheckedSafeCallSubject.propagateTypeFromOriginalReceiver(nullableReceiverExpression: FirExpression, session: FirSession) {
|
||||
val receiverType = nullableReceiverExpression.typeRef.coneTypeSafe<ConeKotlinType>() ?: return
|
||||
// If the receiver expression is smartcast to `null`, it would have `Nothing?` as its type, which may not have members called by user
|
||||
// code. Hence, we fallback to the type before intersecting with `Nothing?`.
|
||||
val receiverType = ((nullableReceiverExpression as? FirExpressionWithSmartcastToNull)
|
||||
?.takeIf { it.isStable }
|
||||
?.smartcastTypeWithoutNullableNothing
|
||||
?: nullableReceiverExpression.typeRef)
|
||||
.coneTypeSafe<ConeKotlinType>() ?: return
|
||||
|
||||
val expandedReceiverType = if (receiverType is ConeClassLikeType) receiverType.fullyExpandedType(session) else receiverType
|
||||
|
||||
|
||||
@@ -11,8 +11,8 @@ import org.jetbrains.kotlin.fir.declarations.FirClass
|
||||
import org.jetbrains.kotlin.fir.declarations.FirRegularClass
|
||||
import org.jetbrains.kotlin.fir.declarations.FirResolvePhase
|
||||
import org.jetbrains.kotlin.fir.expressions.FirExpressionWithSmartcast
|
||||
import org.jetbrains.kotlin.fir.expressions.FirExpressionWithSmartcastToNull
|
||||
import org.jetbrains.kotlin.fir.resolve.substitution.substitutorByMap
|
||||
import org.jetbrains.kotlin.fir.symbols.ensureResolved
|
||||
import org.jetbrains.kotlin.fir.scopes.FakeOverrideTypeCalculator
|
||||
import org.jetbrains.kotlin.fir.scopes.FirTypeScope
|
||||
import org.jetbrains.kotlin.fir.scopes.FirUnstableSmartcastTypeScope
|
||||
@@ -20,6 +20,7 @@ import org.jetbrains.kotlin.fir.scopes.impl.FirScopeWithFakeOverrideTypeCalculat
|
||||
import org.jetbrains.kotlin.fir.scopes.impl.FirStandardOverrideChecker
|
||||
import org.jetbrains.kotlin.fir.scopes.impl.FirTypeIntersectionScope
|
||||
import org.jetbrains.kotlin.fir.scopes.scopeForClass
|
||||
import org.jetbrains.kotlin.fir.symbols.ensureResolved
|
||||
import org.jetbrains.kotlin.fir.symbols.impl.ConeClassLikeLookupTagImpl
|
||||
import org.jetbrains.kotlin.fir.symbols.impl.FirClassSymbol
|
||||
import org.jetbrains.kotlin.fir.symbols.impl.FirTypeParameterSymbol
|
||||
@@ -33,7 +34,8 @@ fun FirExpressionWithSmartcast.smartcastScope(
|
||||
useSiteSession: FirSession,
|
||||
scopeSession: ScopeSession
|
||||
): FirTypeScope? {
|
||||
val smartcastType = smartcastType.coneType
|
||||
val smartcastType =
|
||||
if (this is FirExpressionWithSmartcastToNull) smartcastTypeWithoutNullableNothing.coneType else smartcastType.coneType
|
||||
val smartcastScope = smartcastType.scope(useSiteSession, scopeSession, FakeOverrideTypeCalculator.DoNothing)
|
||||
if (isStable) {
|
||||
return smartcastScope
|
||||
|
||||
@@ -7,9 +7,7 @@ package org.jetbrains.kotlin.fir.resolve.calls
|
||||
|
||||
import org.jetbrains.kotlin.fir.FirSession
|
||||
import org.jetbrains.kotlin.fir.diagnostics.ConeIntermediateDiagnostic
|
||||
import org.jetbrains.kotlin.fir.expressions.FirExpression
|
||||
import org.jetbrains.kotlin.fir.expressions.FirExpressionWithSmartcast
|
||||
import org.jetbrains.kotlin.fir.expressions.FirThisReceiverExpression
|
||||
import org.jetbrains.kotlin.fir.expressions.*
|
||||
import org.jetbrains.kotlin.fir.expressions.builder.buildExpressionWithSmartcast
|
||||
import org.jetbrains.kotlin.fir.expressions.builder.buildThisReceiverExpression
|
||||
import org.jetbrains.kotlin.fir.references.builder.buildImplicitThisReference
|
||||
@@ -60,9 +58,18 @@ abstract class AbstractExplicitReceiverValue<E : FirExpression> : AbstractExplic
|
||||
class ExpressionReceiverValue(
|
||||
override val explicitReceiver: FirExpression
|
||||
) : AbstractExplicitReceiverValue<FirExpression>(), ReceiverValue {
|
||||
override fun scope(useSiteSession: FirSession, scopeSession: ScopeSession): FirTypeScope? =
|
||||
(receiverExpression as? FirExpressionWithSmartcast)?.smartcastScope(useSiteSession, scopeSession)
|
||||
?: type.scope(useSiteSession, scopeSession, FakeOverrideTypeCalculator.DoNothing)
|
||||
override fun scope(useSiteSession: FirSession, scopeSession: ScopeSession): FirTypeScope? {
|
||||
var receiverExpr: FirExpression? = receiverExpression
|
||||
// Unwrap `x!!` to `x` and use the resulted expression to derive receiver type. This is necessary so that smartcast types inside
|
||||
// `!!` is handled correctly.
|
||||
if (receiverExpr is FirCheckNotNullCall) {
|
||||
receiverExpr = receiverExpr.arguments.firstOrNull()
|
||||
}
|
||||
if (receiverExpr is FirExpressionWithSmartcast) {
|
||||
return receiverExpr.smartcastScope(useSiteSession, scopeSession)
|
||||
}
|
||||
return type.scope(useSiteSession, scopeSession, FakeOverrideTypeCalculator.DoNothing)
|
||||
}
|
||||
}
|
||||
|
||||
sealed class ImplicitReceiverValue<S : FirBasedSymbol<*>>(
|
||||
|
||||
@@ -6,7 +6,6 @@
|
||||
package org.jetbrains.kotlin.fir.resolve.calls
|
||||
|
||||
import org.jetbrains.kotlin.descriptors.Modality
|
||||
import org.jetbrains.kotlin.fir.*
|
||||
import org.jetbrains.kotlin.fir.FirVisibilityChecker
|
||||
import org.jetbrains.kotlin.fir.declarations.*
|
||||
import org.jetbrains.kotlin.fir.declarations.utils.isInfix
|
||||
@@ -23,13 +22,14 @@ import org.jetbrains.kotlin.fir.symbols.impl.FirCallableSymbol
|
||||
import org.jetbrains.kotlin.fir.symbols.impl.FirFunctionSymbol
|
||||
import org.jetbrains.kotlin.fir.symbols.impl.FirNamedFunctionSymbol
|
||||
import org.jetbrains.kotlin.fir.symbols.impl.FirRegularClassSymbol
|
||||
import org.jetbrains.kotlin.fir.typeContext
|
||||
import org.jetbrains.kotlin.fir.types.*
|
||||
import org.jetbrains.kotlin.fir.visibilityChecker
|
||||
import org.jetbrains.kotlin.name.ClassId
|
||||
import org.jetbrains.kotlin.name.FqName
|
||||
import org.jetbrains.kotlin.name.Name
|
||||
import org.jetbrains.kotlin.resolve.calls.tasks.ExplicitReceiverKind.*
|
||||
import org.jetbrains.kotlin.types.AbstractNullabilityChecker
|
||||
import org.jetbrains.kotlin.types.SmartcastStability
|
||||
|
||||
abstract class ResolutionStage {
|
||||
abstract suspend fun check(candidate: Candidate, callInfo: CallInfo, sink: CheckerSink, context: ResolutionContext)
|
||||
@@ -116,9 +116,8 @@ object CheckDispatchReceiver : ResolutionStage() {
|
||||
(candidate.originScope as? FirUnstableSmartcastTypeScope)?.isSymbolFromUnstableSmartcast(candidate.symbol) == true
|
||||
|
||||
if (explicitReceiverExpression is FirExpressionWithSmartcast &&
|
||||
explicitReceiverExpression !is FirExpressionWithSmartcastToNull &&
|
||||
explicitReceiverExpression.smartcastStability != SmartcastStability.STABLE_VALUE &&
|
||||
(isCandidateFromUnstableSmartcast || isReceiverNullable)
|
||||
!explicitReceiverExpression.isStable &&
|
||||
(isCandidateFromUnstableSmartcast || (isReceiverNullable && !explicitReceiverExpression.smartcastType.canBeNull))
|
||||
) {
|
||||
sink.yieldDiagnostic(UnstableSmartCast(explicitReceiverExpression, explicitReceiverExpression.smartcastType.coneType))
|
||||
} else if (isReceiverNullable) {
|
||||
|
||||
+1
-8
@@ -1124,14 +1124,7 @@ abstract class FirDataFlowAnalyzer<FLOW : Flow>(
|
||||
}
|
||||
|
||||
if (isAssignment) {
|
||||
if (initializer is FirConstExpression<*> && initializer.kind == ConstantValueKind.Null) {
|
||||
flow.addTypeStatement(
|
||||
propertyVariable typeEq
|
||||
property.returnTypeRef.coneType.withNullability(ConeNullability.NULLABLE, components.session.typeContext)
|
||||
)
|
||||
} else {
|
||||
flow.addTypeStatement(propertyVariable typeEq initializer.typeRef.coneType)
|
||||
}
|
||||
flow.addTypeStatement(propertyVariable typeEq initializer.typeRef.coneType)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+1
@@ -36,6 +36,7 @@ abstract class FirExpressionWithSmartcastToNull : FirExpressionWithSmartcast() {
|
||||
abstract override val typesFromSmartCast: Collection<ConeKotlinType>
|
||||
abstract override val originalType: FirTypeRef
|
||||
abstract override val smartcastType: FirTypeRef
|
||||
abstract val smartcastTypeWithoutNullableNothing: FirTypeRef
|
||||
abstract override val smartcastStability: SmartcastStability
|
||||
|
||||
override fun <R, D> accept(visitor: FirVisitor<R, D>, data: D): R = visitor.visitExpressionWithSmartcastToNull(this, data)
|
||||
|
||||
+9
-1
@@ -17,9 +17,17 @@ class FirExpressionWithSmartcastToNullBuilder {
|
||||
lateinit var smartcastType: FirTypeRef
|
||||
lateinit var typesFromSmartCast: Collection<ConeKotlinType>
|
||||
lateinit var smartcastStability: SmartcastStability
|
||||
lateinit var smartcastTypeWithoutNullableNothing: FirTypeRef
|
||||
|
||||
fun build(): FirExpressionWithSmartcastToNull {
|
||||
return FirExpressionWithSmartcastToNullImpl(originalExpression, smartcastType, typesFromSmartCast, smartcastStability, listOf())
|
||||
return FirExpressionWithSmartcastToNullImpl(
|
||||
originalExpression,
|
||||
smartcastType,
|
||||
typesFromSmartCast,
|
||||
smartcastStability,
|
||||
smartcastTypeWithoutNullableNothing,
|
||||
listOf()
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+1
@@ -27,6 +27,7 @@ class FirExpressionWithSmartcastToNullImpl(
|
||||
override val smartcastType: FirTypeRef,
|
||||
override val typesFromSmartCast: Collection<ConeKotlinType>,
|
||||
override val smartcastStability: SmartcastStability,
|
||||
override val smartcastTypeWithoutNullableNothing: FirTypeRef,
|
||||
override val nonFatalDiagnostics: List<ConeDiagnostic>
|
||||
) : FirExpressionWithSmartcastToNull() {
|
||||
init {
|
||||
|
||||
+1
@@ -466,6 +466,7 @@ object NodeConfigurator : AbstractFieldConfigurator<FirTreeBuilder>(FirTreeBuild
|
||||
+field("typesFromSmartCast", "Collection<ConeKotlinType>", null, customType = coneKotlinTypeType)
|
||||
+field("originalType", typeRef)
|
||||
+field("smartcastType", typeRef)
|
||||
+field("smartcastTypeWithoutNullableNothing", typeRef)
|
||||
+smartcastStability
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
// DONT_TARGET_EXACT_BACKEND: WASM
|
||||
// WASM_MUTE_REASON: NULL_REF_CAST
|
||||
// IGNORE_BACKEND_FIR: JVM_IR
|
||||
fun String?.foo() = this ?: "OK"
|
||||
|
||||
fun foo(i: Int?): String {
|
||||
|
||||
@@ -5,24 +5,24 @@ class A() {
|
||||
fun f(): Unit {
|
||||
var x: Int? = 1
|
||||
x = null
|
||||
x <!UNSAFE_OPERATOR_CALL!>+<!> 1
|
||||
x + 1
|
||||
x <!UNSAFE_INFIX_CALL!>plus<!> 1
|
||||
x <!UNSAFE_OPERATOR_CALL!><<!> 1
|
||||
x <!UNSAFE_OPERATOR_CALL!>+=<!> 1
|
||||
<!ASSIGNMENT_TYPE_MISMATCH!>x += 1<!>
|
||||
|
||||
x == 1
|
||||
x != 1
|
||||
|
||||
<!EQUALITY_NOT_APPLICABLE!>A() == 1<!>
|
||||
|
||||
<!EQUALITY_NOT_APPLICABLE!>x === "1"<!>
|
||||
<!EQUALITY_NOT_APPLICABLE!>x !== "1"<!>
|
||||
x === "1"
|
||||
x !== "1"
|
||||
|
||||
x === 1
|
||||
x !== 1
|
||||
|
||||
x<!UNSAFE_OPERATOR_CALL!>..<!>2
|
||||
<!ARGUMENT_TYPE_MISMATCH!>x<!> in 1..2
|
||||
x..2
|
||||
x in 1..2
|
||||
|
||||
val y : Boolean? = true
|
||||
false || <!CONDITION_TYPE_MISMATCH!>y<!>
|
||||
|
||||
@@ -8,7 +8,7 @@ fun foo(): Int {
|
||||
if (x != null) return x
|
||||
|
||||
val y: Int? = null
|
||||
if (y == null) return if (y != null) y else y
|
||||
if (y == null) return <!RETURN_TYPE_MISMATCH!>if (y != null) y else y<!>
|
||||
|
||||
val z: Int? = null
|
||||
if (z != null) return if (z == null) z else z
|
||||
|
||||
Vendored
+9
-9
@@ -173,15 +173,15 @@ fun test() {
|
||||
if (get() === null) {}
|
||||
|
||||
if (x == null) {
|
||||
x<!UNNECESSARY_SAFE_CALL!>?.<!>hashCode()
|
||||
x?.hashCode()
|
||||
}
|
||||
|
||||
if (x == null) {
|
||||
x<!UNNECESSARY_SAFE_CALL!>?.<!><!NONE_APPLICABLE!>equals<!>(1)
|
||||
x?.<!NONE_APPLICABLE!>equals<!>(1)
|
||||
}
|
||||
|
||||
if (x == null) {
|
||||
x<!UNNECESSARY_SAFE_CALL!>?.<!>test2()
|
||||
x?.test2()
|
||||
}
|
||||
|
||||
if (x == null) {
|
||||
@@ -189,15 +189,15 @@ fun test() {
|
||||
}
|
||||
|
||||
if (x === null) {
|
||||
x<!UNNECESSARY_SAFE_CALL!>?.<!>hashCode()
|
||||
x?.hashCode()
|
||||
}
|
||||
|
||||
if (x === null) {
|
||||
x<!UNNECESSARY_SAFE_CALL!>?.<!><!NONE_APPLICABLE!>equals<!>(1)
|
||||
x?.<!NONE_APPLICABLE!>equals<!>(1)
|
||||
}
|
||||
|
||||
if (x === null) {
|
||||
x<!UNNECESSARY_SAFE_CALL!>?.<!>test2()
|
||||
x?.test2()
|
||||
}
|
||||
|
||||
if (x === null) {
|
||||
@@ -303,9 +303,9 @@ fun test() {
|
||||
if (get() === null) {}
|
||||
|
||||
if (x == null) {
|
||||
x<!UNNECESSARY_SAFE_CALL!>?.<!>hashCode()
|
||||
x<!UNNECESSARY_SAFE_CALL!>?.<!><!NONE_APPLICABLE!>equals<!>(1)
|
||||
x<!UNNECESSARY_SAFE_CALL!>?.<!>test2()
|
||||
x?.hashCode()
|
||||
x?.<!NONE_APPLICABLE!>equals<!>(1)
|
||||
x?.test2()
|
||||
x.test2()
|
||||
}
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@ fun foo(): String {
|
||||
var t: String? = "y"
|
||||
if (t == null) t = "x"
|
||||
var x: Int? = null
|
||||
if (x == null) x <!UNSAFE_OPERATOR_CALL!>+=<!> null
|
||||
if (x == null) <!ASSIGNMENT_TYPE_MISMATCH!>x += null<!>
|
||||
return t + s
|
||||
}
|
||||
|
||||
@@ -16,7 +16,7 @@ fun String?.gav() {}
|
||||
fun bar(s: String?) {
|
||||
if (s != null) return
|
||||
s.gav()
|
||||
s <!USELESS_CAST!>as? String<!>
|
||||
s <!USELESS_CAST!>as String?<!>
|
||||
s as? String
|
||||
s as String?
|
||||
s as String
|
||||
}
|
||||
|
||||
@@ -1,16 +0,0 @@
|
||||
// FILE: My.java
|
||||
|
||||
public class My {
|
||||
static public My create() { return new My(); }
|
||||
public void foo() {}
|
||||
}
|
||||
|
||||
// FILE: Test.kt
|
||||
|
||||
fun test() {
|
||||
val my = My.create()
|
||||
if (my == null) {
|
||||
my.foo()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
// FIR_IDENTICAL
|
||||
// FILE: My.java
|
||||
|
||||
public class My {
|
||||
|
||||
@@ -7,14 +7,14 @@ class TestWithEquals {
|
||||
}
|
||||
|
||||
fun bar(i: Test?) {
|
||||
if (i == null) foo(<!ARGUMENT_TYPE_MISMATCH!>i<!>)
|
||||
if (i == null) foo(i)
|
||||
}
|
||||
|
||||
fun bar(i: TestWithEquals?) {
|
||||
if (i == null) foo(<!ARGUMENT_TYPE_MISMATCH!>i<!>)
|
||||
if (null == i) foo(<!ARGUMENT_TYPE_MISMATCH!>i<!>)
|
||||
if (i == null) foo(i)
|
||||
if (null == i) foo(i)
|
||||
when (i) {
|
||||
null -> foo(<!ARGUMENT_TYPE_MISMATCH!>i<!>)
|
||||
null -> foo(i)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -22,4 +22,4 @@ fun gav(i: TestWithEquals?, j: TestWithEquals?) {
|
||||
if (j == null) {
|
||||
if (i == j) foo(<!ARGUMENT_TYPE_MISMATCH!>i<!>)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Vendored
+2
-2
@@ -19,11 +19,11 @@ fun g(x: B<Int>) {
|
||||
val y = x.content
|
||||
if (y == null) {
|
||||
f(y)
|
||||
g(y)
|
||||
<!NONE_APPLICABLE!>g<!>(y)
|
||||
}
|
||||
|
||||
if (y is Nothing?) {
|
||||
f(y)
|
||||
g(y)
|
||||
<!NONE_APPLICABLE!>g<!>(y)
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
fun foo(): Int {
|
||||
var i: Int? = 42
|
||||
i = null
|
||||
return i <!UNSAFE_OPERATOR_CALL!>+<!> 1
|
||||
return <!RETURN_TYPE_MISMATCH, TYPE_MISMATCH!>i + 1<!>
|
||||
}
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
package
|
||||
|
||||
public fun foo(/*0*/ n: kotlin.Nothing, /*1*/ nn: kotlin.Nothing?): kotlin.Unit
|
||||
public fun test1(/*0*/ n: kotlin.Nothing): kotlin.Unit
|
||||
public fun test2(/*0*/ n: kotlin.Nothing?): kotlin.Unit
|
||||
public fun test3(/*0*/ n: kotlin.Nothing?): kotlin.Unit
|
||||
|
||||
|
||||
Vendored
+6
-3
@@ -1,3 +1,4 @@
|
||||
// FIR_IDE_IGNORE
|
||||
// !USE_EXPERIMENTAL: kotlin.contracts.ExperimentalContracts
|
||||
// SKIP_TXT
|
||||
|
||||
@@ -10,13 +11,15 @@ fun case_1(value_1: Any?) {
|
||||
// TESTCASE NUMBER: 2
|
||||
fun case_2(value_1: Int?) {
|
||||
funWithReturnsAndInvertCondition(value_1 != null)
|
||||
println(value_1<!UNSAFE_CALL!>.<!>inc())
|
||||
println(value_1.inc()) // inc resolves to compiler/tests-spec/testData/diagnostics/helpers/classes.kt which accepts `Class?`
|
||||
println(value_1<!UNSAFE_CALL!>.<!>unaryPlus())
|
||||
}
|
||||
|
||||
// TESTCASE NUMBER: 3
|
||||
fun case_3(value_1: Int?) {
|
||||
funWithReturns(value_1 == null)
|
||||
println(value_1<!UNSAFE_CALL!>.<!>inc())
|
||||
println(value_1.inc()) // inc resolves to compiler/tests-spec/testData/diagnostics/helpers/classes.kt which accepts `Class?`
|
||||
println(value_1<!UNSAFE_CALL!>.<!>unaryPlus())
|
||||
}
|
||||
|
||||
// TESTCASE NUMBER: 4
|
||||
@@ -43,7 +46,7 @@ object case_7_object {
|
||||
}
|
||||
fun case_7() {
|
||||
funWithReturns(case_7_object.prop_1 == null)
|
||||
case_7_object.prop_1<!UNSAFE_CALL!>.<!>inc()
|
||||
case_7_object.prop_1.inc() // inc resolves to compiler/tests-spec/testData/diagnostics/helpers/classes.kt which accepts `Class?`
|
||||
}
|
||||
|
||||
// TESTCASE NUMBER: 8
|
||||
|
||||
+3
@@ -1,3 +1,4 @@
|
||||
// FIR_IDE_IGNORE
|
||||
// !USE_EXPERIMENTAL: kotlin.contracts.ExperimentalContracts
|
||||
// SKIP_TXT
|
||||
|
||||
@@ -20,12 +21,14 @@ fun case_1(value_1: Any?) {
|
||||
fun case_2(value_1: Int?) {
|
||||
funWithReturnsAndInvertCondition(value_1 != null)
|
||||
println(value_1<!UNSAFE_CALL!>.<!>inc())
|
||||
println(value_1<!UNSAFE_CALL!>.<!>unaryPlus())
|
||||
}
|
||||
|
||||
// TESTCASE NUMBER: 3
|
||||
fun case_3(value_1: Int?) {
|
||||
funWithReturns(value_1 == null)
|
||||
println(value_1<!UNSAFE_CALL!>.<!>inc())
|
||||
println(value_1<!UNSAFE_CALL!>.<!>unaryPlus())
|
||||
}
|
||||
|
||||
// TESTCASE NUMBER: 4
|
||||
|
||||
Vendored
+1
-1
@@ -116,7 +116,7 @@ fun case_5(value_1: Number?, value_2: String?) {
|
||||
fun case_6(value_1: Number, value_2: String?, value_3: Any?) {
|
||||
when (value_3.case_6(value_1, value_2)) {
|
||||
true -> {
|
||||
println(value_3<!UNSAFE_CALL!>.<!>equals(""))
|
||||
println(value_3.equals("")) // OK because `value_3` is `Nothing?` and `equals` resolves to `kotlin/text/equals`, which has `String?` as receiver type.
|
||||
println(value_2<!UNSAFE_CALL!>.<!>length)
|
||||
}
|
||||
false -> {
|
||||
|
||||
+1
-1
@@ -126,7 +126,7 @@ fun case_5(value_1: Number?, value_2: String?) {
|
||||
fun case_6(value_1: Number, value_2: String?, value_3: Any?) {
|
||||
when (value_3.case_6(value_1, value_2)) {
|
||||
true -> {
|
||||
println(value_3.equals(""))
|
||||
println(value_3.equals("")) // OK because `value_3` is `Nothing?` and `equals` resolves to `kotlin/text/equals`, which has `String?` as receiver type.
|
||||
println(value_2<!UNSAFE_CALL!>.<!>length)
|
||||
}
|
||||
false -> {
|
||||
|
||||
@@ -87,7 +87,7 @@ fun case_6(x: EmptyClass?) {
|
||||
|
||||
// TESTCASE NUMBER: 7
|
||||
fun case_7() {
|
||||
if (nullableNumberProperty != null || <!EQUALITY_NOT_APPLICABLE!><!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Number? & kotlin.Number?")!>nullableNumberProperty<!> != null is Boolean<!>) {
|
||||
if (nullableNumberProperty != null || <!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Number? & kotlin.Nothing?")!>nullableNumberProperty<!> != null is Boolean) {
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Number?")!>nullableNumberProperty<!>
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Number?")!>nullableNumberProperty<!><!UNSAFE_CALL!>.<!>equals(null)
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Number?")!>nullableNumberProperty<!>.propT
|
||||
@@ -262,8 +262,8 @@ fun case_16() {
|
||||
|
||||
// TESTCASE NUMBER: 17
|
||||
val case_17 = if (nullableIntProperty == null == true == false) 0 else {
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Int? & kotlin.Int?")!>nullableIntProperty<!>
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Int? & kotlin.Int?")!>nullableIntProperty<!>.<!UNRESOLVED_REFERENCE!>java<!>
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Int? & kotlin.Nothing?")!>nullableIntProperty<!>
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Int? & kotlin.Nothing?")!>nullableIntProperty<!><!UNSAFE_CALL!>.<!>java
|
||||
}
|
||||
|
||||
//TESTCASE NUMBER: 18
|
||||
@@ -440,18 +440,18 @@ fun case_25(b: Boolean) {
|
||||
// TESTCASE NUMBER: 26
|
||||
fun case_26(a: ((Float) -> Int?)?, b: Float?) {
|
||||
if (a != null == true == false && b != null == true == false) {
|
||||
val x = <!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Int?")!><!UNSAFE_IMPLICIT_INVOKE_CALL!>a<!>(<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Float? & kotlin.Float?")!>b<!>)<!>
|
||||
val x = <!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Int?")!><!UNSAFE_IMPLICIT_INVOKE_CALL!>a<!>(<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Float? & kotlin.Nothing?")!>b<!>)<!>
|
||||
if (x != null == true === false) {
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Int? & kotlin.Int?")!>x<!>
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Int? & kotlin.Int?")!>x<!><!UNSAFE_CALL!>.<!>equals(null)
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Int? & kotlin.Int?")!>x<!>.propT
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Int? & kotlin.Int?")!>x<!><!UNSAFE_CALL!>.<!>propAny
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Int? & kotlin.Int?")!>x<!>.propNullableT
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Int? & kotlin.Int?")!>x<!>.propNullableAny
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Int? & kotlin.Int?")!>x<!>.funT()
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Int? & kotlin.Int?")!>x<!><!UNSAFE_CALL!>.<!>funAny()
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Int? & kotlin.Int?")!>x<!>.funNullableT()
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Int? & kotlin.Int?")!>x<!>.funNullableAny()
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Int? & kotlin.Nothing?")!>x<!>
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Int? & kotlin.Nothing?")!>x<!>.equals(null)
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Int? & kotlin.Nothing?")!>x<!>.propT
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Int? & kotlin.Nothing?")!>x<!><!UNSAFE_CALL!>.<!>propAny
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Int? & kotlin.Nothing?")!>x<!>.propNullableT
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Int? & kotlin.Nothing?")!>x<!>.propNullableAny
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Int? & kotlin.Nothing?")!>x<!>.funT()
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Int? & kotlin.Nothing?")!>x<!><!UNSAFE_CALL!>.<!>funAny()
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Int? & kotlin.Nothing?")!>x<!>.funNullableT()
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Int? & kotlin.Nothing?")!>x<!>.funNullableAny()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -35,8 +35,8 @@ fun case_4() {
|
||||
var x: Boolean? = true
|
||||
if (<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Boolean?")!>x<!> != null) {
|
||||
false || when { else -> {x = null; true} }
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Boolean?")!>x<!>
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Boolean?")!>x<!><!UNSAFE_CALL!>.<!>not()
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Boolean? & kotlin.Nothing?")!>x<!>
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Boolean? & kotlin.Nothing?")!>x<!><!UNSAFE_CALL!>.<!>not()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -37,8 +37,8 @@ fun case_3() {
|
||||
var x: Boolean? = true
|
||||
if (x != null) {
|
||||
false || when { else -> { x = null; true} }
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Boolean?")!>x<!>
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Boolean?")!>x<!><!UNSAFE_CALL!>.<!>not()
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Boolean? & kotlin.Nothing?")!>x<!>
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Boolean? & kotlin.Nothing?")!>x<!><!UNSAFE_CALL!>.<!>not()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -64,7 +64,7 @@ fun case_4() {
|
||||
fun case_5() {
|
||||
var x: Boolean? = true
|
||||
if (x != null) {
|
||||
when { else -> { x = null; false} } || <!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Boolean?")!>x<!><!UNSAFE_CALL!>.<!>not()
|
||||
when { else -> { x = null; false} } || <!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Boolean? & kotlin.Nothing?")!>x<!><!UNSAFE_CALL!>.<!>not()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -18,8 +18,8 @@ fun case_1(x: ClassWithCustomEquals) {
|
||||
// TESTCASE NUMBER: 2
|
||||
fun case_2(x: ClassWithCustomEquals) {
|
||||
if (x == null) {
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("ClassWithCustomEquals & ClassWithCustomEquals")!>x<!>
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("ClassWithCustomEquals & ClassWithCustomEquals")!>x<!>.<!UNRESOLVED_REFERENCE!>inv<!>()
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("ClassWithCustomEquals & kotlin.Nothing")!>x<!>
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("ClassWithCustomEquals & kotlin.Nothing")!>x<!>.inv()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -76,8 +76,8 @@ fun case_6(x: ClassWithCustomEquals) {
|
||||
// TESTCASE NUMBER: 7
|
||||
fun case_7(x: ClassWithCustomEquals) {
|
||||
if ((x != null) == false) {
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("ClassWithCustomEquals & ClassWithCustomEquals")!>x<!>
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("ClassWithCustomEquals & ClassWithCustomEquals")!>x<!>.<!UNRESOLVED_REFERENCE!>inv<!>()
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("ClassWithCustomEquals & kotlin.Nothing")!>x<!>
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("ClassWithCustomEquals & kotlin.Nothing")!>x<!>.inv()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -37,8 +37,8 @@ fun case_4(x: Any) {
|
||||
// TESTCASE NUMBER: 5
|
||||
fun case_5(x: Any?) {
|
||||
if (!(x !is Nothing?)) {
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Any? & kotlin.Any")!>x<!>
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Any? & kotlin.Any")!>x<!><!UNNECESSARY_SAFE_CALL!>?.<!><!UNRESOLVED_REFERENCE!>inv<!>()
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Any? & kotlin.Nothing")!>x<!>
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Any? & kotlin.Nothing")!>x<!><!UNNECESSARY_SAFE_CALL!>?.<!><!UNRESOLVED_REFERENCE!>inv<!>()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -61,16 +61,16 @@ fun case_7(x: Any) {
|
||||
// TESTCASE NUMBER: 8
|
||||
fun case_8(x: Any?) {
|
||||
if (!(x is Nothing?)) else {
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Any? & kotlin.Any?")!>x<!>
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Any? & kotlin.Any?")!>x<!>?.<!UNRESOLVED_REFERENCE!>inv<!>()
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Any? & kotlin.Nothing?")!>x<!>
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Any? & kotlin.Nothing?")!>x<!>?.<!UNRESOLVED_REFERENCE!>inv<!>()
|
||||
}
|
||||
}
|
||||
|
||||
// TESTCASE NUMBER: 9
|
||||
fun case_9(x: Any?) {
|
||||
if (!!(x !is Nothing?)) else {
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Any? & kotlin.Any")!>x<!>
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Any? & kotlin.Any")!>x<!><!UNNECESSARY_SAFE_CALL!>?.<!><!UNRESOLVED_REFERENCE!>inv<!>()
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Any? & kotlin.Nothing")!>x<!>
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Any? & kotlin.Nothing")!>x<!><!UNNECESSARY_SAFE_CALL!>?.<!><!UNRESOLVED_REFERENCE!>inv<!>()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -85,7 +85,7 @@ fun case_10(x: Any?) {
|
||||
// TESTCASE NUMBER: 11
|
||||
fun case_11(x: Any?) {
|
||||
if (x is Nothing?) {
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Any? & kotlin.Any?")!>x<!>
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Any? & kotlin.Any?")!>x<!>?.<!UNRESOLVED_REFERENCE!>inv<!>()
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Any? & kotlin.Nothing?")!>x<!>
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Any? & kotlin.Nothing?")!>x<!>?.<!UNRESOLVED_REFERENCE!>inv<!>()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -13,7 +13,7 @@ class Case1 {
|
||||
val y = this
|
||||
if (y.x != null) {
|
||||
x = null
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Int?")!>x<!>
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Int? & kotlin.Nothing?")!>x<!>
|
||||
this.x
|
||||
y.x
|
||||
y.x<!UNSAFE_CALL!>.<!>inv()
|
||||
|
||||
@@ -31,8 +31,8 @@ inline fun <reified T, reified K> case_3() {
|
||||
var x: T? = 10 as T
|
||||
x = null
|
||||
if (x is K) {
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("T? & T?!! & K!!")!>x<!>.equals(10)
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("T? & T?!! & K!!")!>x<!>
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("T? & kotlin.Nothing")!>x<!>.equals(10)
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("T? & kotlin.Nothing")!>x<!>
|
||||
println(1)
|
||||
}
|
||||
}
|
||||
@@ -61,8 +61,8 @@ inline fun <reified T, reified K> case_6() {
|
||||
var x: T? = 10 as T
|
||||
if (x is K) {
|
||||
x = null
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("T?")!>x<!><!UNSAFE_CALL!>.<!>equals(10)
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("T?")!>x<!>
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("T? & kotlin.Nothing?")!>x<!><!UNSAFE_CALL!>.<!>equals(10)
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("T? & kotlin.Nothing?")!>x<!>
|
||||
println(1)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,8 +9,8 @@ fun case_1(a: Any?) {
|
||||
if (true) continue
|
||||
}
|
||||
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Any? & kotlin.Any?")!>a<!>
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Any? & kotlin.Any?")!>a<!><!UNSAFE_CALL!>.<!>equals(10)
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Any? & kotlin.Nothing?")!>a<!>
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Any? & kotlin.Nothing?")!>a<!><!UNSAFE_CALL!>.<!>equals(10)
|
||||
}
|
||||
|
||||
// TESTCASE NUMBER: 2
|
||||
|
||||
@@ -12,8 +12,8 @@ fun stringArg(number: String) {}
|
||||
*/
|
||||
fun case_1(x: Int?) {
|
||||
if (x == null) {
|
||||
stringArg(<!ARGUMENT_TYPE_MISMATCH, DEBUG_INFO_EXPRESSION_TYPE("kotlin.Int")!>x!!<!>)
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Int? & kotlin.Int")!>x<!>
|
||||
stringArg(<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Nothing")!>x!!<!>)
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Int? & kotlin.Nothing")!>x<!>
|
||||
}
|
||||
}
|
||||
|
||||
@@ -37,8 +37,8 @@ fun case_2(x: Int?, y: Nothing?) {
|
||||
fun case_3(x: Int?) {
|
||||
if (x == null) {
|
||||
x as Int
|
||||
stringArg(<!ARGUMENT_TYPE_MISMATCH, DEBUG_INFO_EXPRESSION_TYPE("kotlin.Int? & kotlin.Int")!>x<!>)
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Int? & kotlin.Int")!>x<!>
|
||||
stringArg(<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Int? & kotlin.Nothing")!>x<!>)
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Int? & kotlin.Nothing")!>x<!>
|
||||
}
|
||||
}
|
||||
|
||||
@@ -50,8 +50,8 @@ fun case_3(x: Int?) {
|
||||
fun case_4(x: Int?) {
|
||||
if (x == null) {
|
||||
x!!
|
||||
stringArg(<!ARGUMENT_TYPE_MISMATCH, DEBUG_INFO_EXPRESSION_TYPE("kotlin.Int? & kotlin.Int")!>x<!>)
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Int? & kotlin.Int")!>x<!>
|
||||
stringArg(<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Int? & kotlin.Nothing")!>x<!>)
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Int? & kotlin.Nothing")!>x<!>
|
||||
}
|
||||
}
|
||||
|
||||
@@ -64,7 +64,7 @@ fun case_5(x: Int?) {
|
||||
if (x == null) {
|
||||
var y = x
|
||||
y!!
|
||||
stringArg(<!ARGUMENT_TYPE_MISMATCH, DEBUG_INFO_EXPRESSION_TYPE("kotlin.Int? & kotlin.Int")!>y<!>)
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Int? & kotlin.Int")!>y<!>
|
||||
stringArg(<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Int? & kotlin.Nothing")!>y<!>)
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Int? & kotlin.Nothing")!>y<!>
|
||||
}
|
||||
}
|
||||
|
||||
@@ -12,7 +12,7 @@ fun nullableStringArg(number: String?) {}
|
||||
*/
|
||||
fun case_1(x: Int?) {
|
||||
if (x == null) {
|
||||
nullableStringArg(<!ARGUMENT_TYPE_MISMATCH, DEBUG_INFO_EXPRESSION_TYPE("kotlin.Int? & kotlin.Int?")!>x<!>)
|
||||
nullableStringArg(<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Int? & kotlin.Nothing?")!>x<!>)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -34,7 +34,7 @@ fun case_2(x: Int?, y: Nothing?) {
|
||||
*/
|
||||
fun case_3(x: Int?) {
|
||||
if (x == null) {
|
||||
nullableStringArg(<!ARGUMENT_TYPE_MISMATCH, DEBUG_INFO_EXPRESSION_TYPE("kotlin.Int? & kotlin.Int?")!>x<!>)
|
||||
nullableStringArg(<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Int? & kotlin.Nothing?")!>x<!>)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -45,7 +45,7 @@ fun case_3(x: Int?) {
|
||||
*/
|
||||
fun case_4(x: Int?) {
|
||||
if (x == null) {
|
||||
nullableStringArg(<!ARGUMENT_TYPE_MISMATCH, DEBUG_INFO_EXPRESSION_TYPE("kotlin.Int? & kotlin.Int?")!>x<!>)
|
||||
nullableStringArg(<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Int? & kotlin.Nothing?")!>x<!>)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -57,6 +57,6 @@ fun case_4(x: Int?) {
|
||||
fun case_5(x: Int?) {
|
||||
if (x == null) {
|
||||
var y = x
|
||||
nullableStringArg(<!ARGUMENT_TYPE_MISMATCH, DEBUG_INFO_EXPRESSION_TYPE("kotlin.Int? & kotlin.Int?")!>y<!>)
|
||||
nullableStringArg(<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Int? & kotlin.Nothing?")!>y<!>)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -106,8 +106,8 @@ fun case_9() {
|
||||
x = null
|
||||
break
|
||||
} while (x!!.length > 1)
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.String? & kotlin.String")!>x<!>
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.String? & kotlin.String")!>x<!>.length
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.String? & kotlin.Nothing")!>x<!>
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.String? & kotlin.Nothing")!>x<!>.length
|
||||
}
|
||||
|
||||
// TESTCASE NUMBER: 10
|
||||
@@ -117,8 +117,8 @@ fun case_10() {
|
||||
x = null
|
||||
break
|
||||
} while ((x as String).length > 1)
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.String? & kotlin.String")!>x<!>
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.String? & kotlin.String")!>x<!>.length
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.String? & kotlin.Nothing")!>x<!>
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.String? & kotlin.Nothing")!>x<!>.length
|
||||
}
|
||||
|
||||
// TESTCASE NUMBER: 11
|
||||
@@ -128,8 +128,8 @@ fun case_11() {
|
||||
x = null
|
||||
break
|
||||
} while (x!!)
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Boolean? & kotlin.Boolean")!>x<!>
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Boolean? & kotlin.Boolean")!>x<!>.not()
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Boolean? & kotlin.Nothing")!>x<!>
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Boolean? & kotlin.Nothing")!>x<!>.not()
|
||||
}
|
||||
|
||||
// TESTCASE NUMBER: 12
|
||||
@@ -141,8 +141,8 @@ fun case_12() {
|
||||
x = null
|
||||
break
|
||||
} while (true && x!!)
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Boolean?")!>x<!>
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Boolean?")!>x<!><!UNSAFE_CALL!>.<!>not()
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Boolean? & kotlin.Nothing?")!>x<!>
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Boolean? & kotlin.Nothing?")!>x<!><!UNSAFE_CALL!>.<!>not()
|
||||
}
|
||||
|
||||
// TESTCASE NUMBER: 13
|
||||
@@ -154,8 +154,8 @@ fun case_13() {
|
||||
x = null
|
||||
break
|
||||
} while (false && x!!)
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Boolean?")!>x<!>
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Boolean?")!>x<!><!UNSAFE_CALL!>.<!>not()
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Boolean? & kotlin.Nothing?")!>x<!>
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Boolean? & kotlin.Nothing?")!>x<!><!UNSAFE_CALL!>.<!>not()
|
||||
}
|
||||
|
||||
// TESTCASE NUMBER: 14
|
||||
@@ -167,8 +167,8 @@ fun case_14() {
|
||||
x = null
|
||||
break
|
||||
} while (true || x!!)
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Boolean?")!>x<!>
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Boolean?")!>x<!><!UNSAFE_CALL!>.<!>not()
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Boolean? & kotlin.Nothing?")!>x<!>
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Boolean? & kotlin.Nothing?")!>x<!><!UNSAFE_CALL!>.<!>not()
|
||||
}
|
||||
|
||||
// TESTCASE NUMBER: 15
|
||||
@@ -180,8 +180,8 @@ fun case_15() {
|
||||
x = null
|
||||
break
|
||||
} while (!(false && x!!))
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Boolean?")!>x<!>
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Boolean?")!>x<!><!UNSAFE_CALL!>.<!>not()
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Boolean? & kotlin.Nothing?")!>x<!>
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Boolean? & kotlin.Nothing?")!>x<!><!UNSAFE_CALL!>.<!>not()
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
@@ -37,8 +37,8 @@ fun case_3() {
|
||||
var x: String?
|
||||
x = "Test"
|
||||
println("${try { } finally { x = null }}")
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.String?")!>x<!>
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.String?")!>x<!><!UNSAFE_CALL!>.<!>length
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.String? & kotlin.Nothing?")!>x<!>
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.String? & kotlin.Nothing?")!>x<!><!UNSAFE_CALL!>.<!>length
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -76,8 +76,8 @@ fun case_6() {
|
||||
var x: String?
|
||||
x = "Test"
|
||||
println("${try { } catch (e: Exception) { } finally { x = null }}")
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.String?")!>x<!>
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.String?")!>x<!><!UNSAFE_CALL!>.<!>length
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.String? & kotlin.Nothing?")!>x<!>
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.String? & kotlin.Nothing?")!>x<!><!UNSAFE_CALL!>.<!>length
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -115,6 +115,6 @@ fun case_9() {
|
||||
var x: String?
|
||||
x = "Test"
|
||||
println("${when (null) { else -> x = null } }")
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.String?")!>x<!>
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.String?")!>x<!><!UNSAFE_CALL!>.<!>length
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.String? & kotlin.Nothing?")!>x<!>
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.String? & kotlin.Nothing?")!>x<!><!UNSAFE_CALL!>.<!>length
|
||||
}
|
||||
|
||||
@@ -15,8 +15,8 @@ fun case_1() {
|
||||
break@outer
|
||||
}
|
||||
}
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.String? & kotlin.String?")!>x<!>
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.String? & kotlin.String?")!>x<!><!UNSAFE_CALL!>.<!>length
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.String? & kotlin.Nothing?")!>x<!>
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.String? & kotlin.Nothing?")!>x<!><!UNSAFE_CALL!>.<!>length
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -32,8 +32,8 @@ fun case_2() {
|
||||
break@outer
|
||||
}
|
||||
}
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.String? & kotlin.String?")!>x<!>
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.String? & kotlin.String?")!>x<!><!UNSAFE_CALL!>.<!>length
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.String? & kotlin.Nothing?")!>x<!>
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.String? & kotlin.Nothing?")!>x<!><!UNSAFE_CALL!>.<!>length
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -145,8 +145,8 @@ fun case_9() {
|
||||
inner@ do {
|
||||
x = null
|
||||
} while (x != null)
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.String? & kotlin.String?")!>x<!>
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.String? & kotlin.String?")!>x<!><!UNSAFE_CALL!>.<!>length
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.String? & kotlin.Nothing?")!>x<!>
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.String? & kotlin.Nothing?")!>x<!><!UNSAFE_CALL!>.<!>length
|
||||
}
|
||||
}
|
||||
|
||||
@@ -158,8 +158,8 @@ fun case_10() {
|
||||
inner@ do {
|
||||
x = null
|
||||
} while (true)
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.String?")!>x<!>
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.String?")!>x<!><!UNSAFE_CALL!>.<!>length
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.String? & kotlin.Nothing?")!>x<!>
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.String? & kotlin.Nothing?")!>x<!><!UNSAFE_CALL!>.<!>length
|
||||
}
|
||||
}
|
||||
|
||||
@@ -172,7 +172,7 @@ fun case_11() {
|
||||
x = null
|
||||
break
|
||||
} while (x == null)
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.String?")!>x<!>
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.String?")!>x<!><!UNSAFE_CALL!>.<!>length
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.String? & kotlin.Nothing?")!>x<!>
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.String? & kotlin.Nothing?")!>x<!><!UNSAFE_CALL!>.<!>length
|
||||
}
|
||||
}
|
||||
|
||||
@@ -151,8 +151,8 @@ fun case_12() {
|
||||
while (true) {
|
||||
y += if (x == null) break else 10
|
||||
}
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Int? & kotlin.Int?")!>x<!>
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Int? & kotlin.Int?")!>x<!><!UNSAFE_CALL!>.<!>inv()
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Int? & kotlin.Nothing?")!>x<!>
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Int? & kotlin.Nothing?")!>x<!><!UNSAFE_CALL!>.<!>inv()
|
||||
}
|
||||
|
||||
// TESTCASE NUMBER: 13
|
||||
|
||||
@@ -122,7 +122,7 @@ fun case_6(x: EmptyClass?) {
|
||||
|
||||
// TESTCASE NUMBER: 7
|
||||
fun case_7() {
|
||||
if (nullableNumberProperty != null || <!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Number? & kotlin.Number?")!>nullableNumberProperty<!> != null) {
|
||||
if (nullableNumberProperty != null || <!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Number? & kotlin.Nothing?")!>nullableNumberProperty<!> != null) {
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Number? & kotlin.Number")!>nullableNumberProperty<!>
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Number? & kotlin.Number")!>nullableNumberProperty<!>.equals(null)
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Number? & kotlin.Number")!>nullableNumberProperty<!>.propT
|
||||
@@ -1302,11 +1302,11 @@ open class Case29(a: Int?, val b: Float?, private val c: Unit?, protected val d:
|
||||
if (w != null || this.w != null) this.w
|
||||
|
||||
s = null
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Any?")!>s<!>.hashCode()
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Any?")!>s<!>
|
||||
if (s != null) <!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Any? & kotlin.Any")!>s<!>
|
||||
if (this.s != null) <!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Any? & kotlin.Any")!>s<!>
|
||||
if (s != null || this.s != null) <!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Any? & kotlin.Any")!>s<!>
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Any? & kotlin.Nothing?")!>s<!>.hashCode()
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Any? & kotlin.Nothing?")!>s<!>
|
||||
if (s != null) <!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Any? & kotlin.Nothing")!>s<!>
|
||||
if (this.s != null) <!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Any? & kotlin.Nothing")!>s<!>
|
||||
if (s != null || this.s != null) <!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Any? & kotlin.Nothing")!>s<!>
|
||||
if (s != null || this.s != null) this.s
|
||||
}
|
||||
|
||||
@@ -2346,11 +2346,11 @@ sealed class Case30(a: Int?, val b: Float?, private val c: Unit?, protected val
|
||||
if (w != null || this.w != null) this.w
|
||||
|
||||
s = null
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Any?")!>s<!>.hashCode()
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Any?")!>s<!>
|
||||
if (s != null) <!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Any? & kotlin.Any")!>s<!>
|
||||
if (this.s != null) <!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Any? & kotlin.Any")!>s<!>
|
||||
if (s != null || this.s != null) <!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Any? & kotlin.Any")!>s<!>
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Any? & kotlin.Nothing?")!>s<!>.hashCode()
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Any? & kotlin.Nothing?")!>s<!>
|
||||
if (s != null) <!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Any? & kotlin.Nothing")!>s<!>
|
||||
if (this.s != null) <!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Any? & kotlin.Nothing")!>s<!>
|
||||
if (s != null || this.s != null) <!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Any? & kotlin.Nothing")!>s<!>
|
||||
if (s != null || this.s != null) this.s
|
||||
}
|
||||
|
||||
@@ -3391,11 +3391,11 @@ enum class Case31(a: Int?, val b: Float?, private val c: Unit?, protected val d:
|
||||
if (w != null || this.w != null) this.w
|
||||
|
||||
s = null
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Any?")!>s<!>.hashCode()
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Any?")!>s<!>
|
||||
if (s != null) <!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Any? & kotlin.Any")!>s<!>
|
||||
if (this.s != null) <!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Any? & kotlin.Any")!>s<!>
|
||||
if (s != null || this.s != null) <!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Any? & kotlin.Any")!>s<!>
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Any? & kotlin.Nothing?")!>s<!>.hashCode()
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Any? & kotlin.Nothing?")!>s<!>
|
||||
if (s != null) <!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Any? & kotlin.Nothing")!>s<!>
|
||||
if (this.s != null) <!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Any? & kotlin.Nothing")!>s<!>
|
||||
if (s != null || this.s != null) <!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Any? & kotlin.Nothing")!>s<!>
|
||||
if (s != null || this.s != null) this.s
|
||||
}
|
||||
|
||||
@@ -4039,11 +4039,11 @@ object Case32 {
|
||||
if (w != null || this.w != null) this.w
|
||||
|
||||
s = null
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Any?")!>s<!>.hashCode()
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Any?")!>s<!>
|
||||
if (s != null) <!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Any? & kotlin.Any")!>s<!>
|
||||
if (this.s != null) <!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Any? & kotlin.Any")!>s<!>
|
||||
if (s != null || this.s != null) <!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Any? & kotlin.Any")!>s<!>
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Any? & kotlin.Nothing?")!>s<!>.hashCode()
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Any? & kotlin.Nothing?")!>s<!>
|
||||
if (s != null) <!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Any? & kotlin.Nothing")!>s<!>
|
||||
if (this.s != null) <!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Any? & kotlin.Nothing")!>s<!>
|
||||
if (s != null || this.s != null) <!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Any? & kotlin.Nothing")!>s<!>
|
||||
if (s != null || this.s != null) this.s
|
||||
}
|
||||
|
||||
|
||||
@@ -288,7 +288,7 @@ fun case_11(b: Boolean) {
|
||||
if (z != null || b) {
|
||||
|
||||
} else {
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("<anonymous>? & <anonymous>?")!>z<!>
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("<anonymous>? & kotlin.Nothing?")!>z<!>
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -16,14 +16,14 @@ import otherpackage.*
|
||||
// TESTCASE NUMBER: 1
|
||||
fun case_1(x: Any?) {
|
||||
if (x == null) {
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Any? & kotlin.Any?")!>x<!>
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Any? & kotlin.Nothing?")!>x<!>
|
||||
}
|
||||
}
|
||||
|
||||
// TESTCASE NUMBER: 2
|
||||
fun case_2(x: Nothing?) {
|
||||
if (x == null) {
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Nothing? & kotlin.Nothing?")!>x<!>
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Nothing?")!>x<!>
|
||||
}
|
||||
}
|
||||
|
||||
@@ -38,7 +38,7 @@ fun case_3() {
|
||||
// TESTCASE NUMBER: 4
|
||||
fun case_4(x: Char?) {
|
||||
if (x == null && true) {
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Char? & kotlin.Char?")!>x<!>
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Char? & kotlin.Nothing?")!>x<!>
|
||||
}
|
||||
}
|
||||
|
||||
@@ -46,7 +46,7 @@ fun case_4(x: Char?) {
|
||||
fun case_5() {
|
||||
val x: Unit? = null
|
||||
|
||||
if (x == null) <!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Unit? & kotlin.Unit?")!>x<!>
|
||||
if (x == null) <!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Unit? & kotlin.Nothing?")!>x<!>
|
||||
}
|
||||
|
||||
// TESTCASE NUMBER: 6
|
||||
@@ -54,7 +54,7 @@ fun case_6(x: EmptyClass?) {
|
||||
val y = true
|
||||
|
||||
if (x == null && !y) {
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("EmptyClass? & EmptyClass?")!>x<!>
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("EmptyClass? & kotlin.Nothing?")!>x<!>
|
||||
}
|
||||
}
|
||||
|
||||
@@ -67,8 +67,8 @@ fun case_7() {
|
||||
|
||||
// TESTCASE NUMBER: 8
|
||||
fun case_8(x: TypealiasNullableString) {
|
||||
if (x == null && <!DEBUG_INFO_EXPRESSION_TYPE("TypealiasNullableString & TypealiasNullableString")!>x<!> == null)
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("TypealiasNullableString & TypealiasNullableString")!>x<!>
|
||||
if (x == null && <!DEBUG_INFO_EXPRESSION_TYPE("TypealiasNullableString & kotlin.Nothing?")!>x<!> == null)
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("TypealiasNullableString & kotlin.Nothing?")!>x<!>
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -105,7 +105,7 @@ fun case_11(x: TypealiasNullableString?, y: TypealiasNullableString) {
|
||||
if (y == null) {
|
||||
if (nullableStringProperty != null) {
|
||||
if (z == null) {
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("TypealiasNullableString? & TypealiasNullableString?")!>x<!>
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("TypealiasNullableString? & kotlin.Nothing?")!>x<!>
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -172,7 +172,7 @@ fun case_14() {
|
||||
// TESTCASE NUMBER: 15
|
||||
fun case_15(x: TypealiasNullableString) {
|
||||
val t = <!DEBUG_INFO_EXPRESSION_TYPE("kotlin.String?")!>if (x != null) "" else {
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("TypealiasNullableString & TypealiasNullableString")!>x<!>
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("TypealiasNullableString & kotlin.Nothing?")!>x<!>
|
||||
}<!>
|
||||
}
|
||||
|
||||
@@ -187,13 +187,13 @@ fun case_16() {
|
||||
|
||||
// TESTCASE NUMBER: 17
|
||||
val case_17 = <!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Int?")!>if (nullableIntProperty !== null) 0 else {
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Int? & kotlin.Int?")!>nullableIntProperty<!>
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Int? & kotlin.Nothing?")!>nullableIntProperty<!>
|
||||
}<!>
|
||||
|
||||
//TESTCASE NUMBER: 18
|
||||
fun case_18(a: DeepObject.A.B.C.D.E.F.G.J?) {
|
||||
if (a == null) {
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("DeepObject.A.B.C.D.E.F.G.J? & DeepObject.A.B.C.D.E.F.G.J?")!>a<!>
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("DeepObject.A.B.C.D.E.F.G.J? & kotlin.Nothing?")!>a<!>
|
||||
}
|
||||
}
|
||||
|
||||
@@ -249,17 +249,17 @@ fun case_21() {
|
||||
// TESTCASE NUMBER: 22
|
||||
fun case_22(a: (() -> Unit)?) {
|
||||
if (a == null) {
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Function0<kotlin.Unit>? & kotlin.Function0<kotlin.Unit>?")!>a<!>
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Function0<kotlin.Unit>? & kotlin.Nothing?")!>a<!>
|
||||
}
|
||||
}
|
||||
|
||||
// TESTCASE NUMBER: 23
|
||||
fun case_23(a: ((Float) -> Int?)?, b: Float?) {
|
||||
if (a == null && b == null) {
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Function1<kotlin.Float, kotlin.Int?>? & kotlin.Function1<kotlin.Float, kotlin.Int?>?")!>a<!>
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Float? & kotlin.Float?")!>b<!>
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Function1<kotlin.Float, kotlin.Int?>? & kotlin.Nothing?")!>a<!>
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Float? & kotlin.Nothing?")!>b<!>
|
||||
if (a != null) {
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Function1<kotlin.Float, kotlin.Int?>? & kotlin.Function1<kotlin.Float, kotlin.Int?>")!>a<!>
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Function1<kotlin.Float, kotlin.Int?>? & kotlin.Nothing")!>a<!>
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -290,13 +290,13 @@ fun case_25(b: Boolean) {
|
||||
val z = <!DEBUG_INFO_EXPRESSION_TYPE("<anonymous>?")!>y()<!>
|
||||
|
||||
if (z == null) {
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("<anonymous>? & <anonymous>?")!>z<!>
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("<anonymous>? & kotlin.Nothing?")!>z<!>
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// TESTCASE NUMBER: 26
|
||||
fun case_26(a: Int?, b: Int? = if (a !== null) 0 else <!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Int? & kotlin.Int?")!>a<!>) {
|
||||
fun case_26(a: Int?, b: Int? = if (a !== null) 0 else <!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Int? & kotlin.Nothing?")!>a<!>) {
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Int?")!>a<!>
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Int?")!>b<!>
|
||||
}
|
||||
|
||||
@@ -98,7 +98,7 @@ fun case_9(x: Boolean?) {
|
||||
while (x ?: return)
|
||||
while (x == null)
|
||||
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Boolean? & kotlin.Boolean")!>x<!>
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Boolean? & kotlin.Nothing")!>x<!>
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Boolean? & kotlin.Boolean")!>x<!>.equals(10)
|
||||
}
|
||||
|
||||
|
||||
@@ -19,14 +19,14 @@ import otherpackage.*
|
||||
// TESTCASE NUMBER: 1
|
||||
fun case_1(x: Any) {
|
||||
if (x === null) {
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Any & kotlin.Any")!>x<!>
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Any & kotlin.Nothing")!>x<!>
|
||||
}
|
||||
}
|
||||
|
||||
// TESTCASE NUMBER: 2
|
||||
fun case_2(x: Nothing) {
|
||||
if (x == null) {
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Nothing & kotlin.Nothing")!>x<!>
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Nothing")!>x<!>
|
||||
}
|
||||
}
|
||||
|
||||
@@ -41,7 +41,7 @@ fun case_3() {
|
||||
// TESTCASE NUMBER: 4
|
||||
fun case_4(x: Char) {
|
||||
if (x == null && true) {
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Char & kotlin.Char")!>x<!>
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Char & kotlin.Nothing")!>x<!>
|
||||
}
|
||||
}
|
||||
|
||||
@@ -49,7 +49,7 @@ fun case_4(x: Char) {
|
||||
fun case_5() {
|
||||
val x: Unit = kotlin.Unit
|
||||
|
||||
if (x == null) <!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Unit & kotlin.Unit")!>x<!>
|
||||
if (x == null) <!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Unit & kotlin.Nothing")!>x<!>
|
||||
}
|
||||
|
||||
// TESTCASE NUMBER: 6
|
||||
@@ -57,7 +57,7 @@ fun case_6(x: EmptyClass) {
|
||||
val y = true
|
||||
|
||||
if (x == null && !y) {
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("EmptyClass & EmptyClass")!>x<!>
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("EmptyClass & kotlin.Nothing")!>x<!>
|
||||
}
|
||||
}
|
||||
|
||||
@@ -70,7 +70,7 @@ fun case_7() {
|
||||
|
||||
// TESTCASE NUMBER: 8
|
||||
fun case_8(x: TypealiasString) {
|
||||
if (x == null && <!DEBUG_INFO_EXPRESSION_TYPE("TypealiasString & TypealiasString")!>x<!> == null) <!DEBUG_INFO_EXPRESSION_TYPE("TypealiasString & TypealiasString")!>x<!>
|
||||
if (x == null && <!DEBUG_INFO_EXPRESSION_TYPE("TypealiasString & kotlin.Nothing")!>x<!> == null) <!DEBUG_INFO_EXPRESSION_TYPE("TypealiasString")!>x<!>
|
||||
}
|
||||
|
||||
// TESTCASE NUMBER: 9
|
||||
@@ -78,7 +78,7 @@ fun case_9(x: TypealiasString) {
|
||||
if (x != null) {
|
||||
|
||||
} else if (false) {
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("TypealiasString & TypealiasString")!>x<!>
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("TypealiasString & kotlin.Nothing")!>x<!>
|
||||
}
|
||||
}
|
||||
|
||||
@@ -103,7 +103,7 @@ fun case_11(x: TypealiasString, y: TypealiasString) {
|
||||
if (y == null) {
|
||||
if (stringProperty != null) {
|
||||
if (false || false || false || z == null || false) {
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("TypealiasString & TypealiasString")!>x<!>
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("TypealiasString & kotlin.Nothing")!>x<!>
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -112,14 +112,14 @@ fun case_11(x: TypealiasString, y: TypealiasString) {
|
||||
|
||||
// TESTCASE NUMBER: 12
|
||||
fun case_12(x: TypealiasString, y: TypealiasString) = <!DEBUG_INFO_EXPRESSION_TYPE("kotlin.String")!>if (x != null) "1"
|
||||
else if (y !== null) <!DEBUG_INFO_EXPRESSION_TYPE("TypealiasString & TypealiasString")!>x<!>
|
||||
else if (y !== null) <!DEBUG_INFO_EXPRESSION_TYPE("TypealiasString & kotlin.Nothing")!>x<!>
|
||||
else "-1"<!>
|
||||
|
||||
// TESTCASE NUMBER: 13
|
||||
fun case_13(x: otherpackage.EmptyClass13) =
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Any")!>if (x != null) {
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Int")!>if (x != null) {
|
||||
1
|
||||
} else <!DEBUG_INFO_EXPRESSION_TYPE("otherpackage.EmptyClass13 & otherpackage.EmptyClass13")!>x<!><!>
|
||||
} else <!DEBUG_INFO_EXPRESSION_TYPE("otherpackage.EmptyClass13 & kotlin.Nothing")!>x<!><!>
|
||||
|
||||
// TESTCASE NUMBER: 14
|
||||
class A14 {
|
||||
@@ -179,7 +179,7 @@ fun case_16() {
|
||||
val x: TypealiasNothing = return
|
||||
|
||||
if (x == null) {
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("TypealiasNothing & TypealiasNothing")!>x<!>
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("TypealiasNothing")!>x<!>
|
||||
}
|
||||
}
|
||||
|
||||
@@ -195,7 +195,7 @@ val case_17 = <!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Int")!>if (true && true && in
|
||||
//TESTCASE NUMBER: 18
|
||||
fun case_18(a: DeepObject.A.B.C.D.E.F.G.J) {
|
||||
if (a == null) {
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("DeepObject.A.B.C.D.E.F.G.J & DeepObject.A.B.C.D.E.F.G.J")!>a<!>
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("DeepObject.A.B.C.D.E.F.G.J & kotlin.Nothing")!>a<!>
|
||||
}
|
||||
}
|
||||
|
||||
@@ -256,7 +256,7 @@ fun case_22(a: (() -> Unit)) {
|
||||
// TESTCASE NUMBER: 23
|
||||
fun case_23(a: ((Float) -> Int), b: Float) {
|
||||
if (a == null && b == null) {
|
||||
val x = <!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Int")!>a(<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Float & kotlin.Float")!>b<!>)<!>
|
||||
val x = <!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Int")!>a(<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Float & kotlin.Nothing")!>b<!>)<!>
|
||||
if (x !== null) {
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Int")!>x<!>
|
||||
}
|
||||
@@ -276,13 +276,13 @@ fun case_24(a: ((() -> Unit) -> Unit), b: (() -> Unit)) {
|
||||
}
|
||||
|
||||
// TESTCASE NUMBER: 25
|
||||
fun case_25(a: (() -> Unit) -> Unit, b: (() -> Unit) -> Unit = if (a == null) <!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Function1<kotlin.Function0<kotlin.Unit>, kotlin.Unit> & kotlin.Function1<kotlin.Function0<kotlin.Unit>, kotlin.Unit>")!>a<!> else {{}}) {
|
||||
fun case_25(a: (() -> Unit) -> Unit, b: (() -> Unit) -> Unit = if (a == null) <!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Function1<kotlin.Function0<kotlin.Unit>, kotlin.Unit> & kotlin.Nothing")!>a<!> else {{}}) {
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Function1<kotlin.Function0<kotlin.Unit>, kotlin.Unit>")!>a<!>
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Function1<kotlin.Function0<kotlin.Unit>, kotlin.Unit>")!>b<!>
|
||||
}
|
||||
|
||||
// TESTCASE NUMBER: 26
|
||||
fun case_26(a: Int, b: Int = if (a === null) <!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Int & kotlin.Int")!>a<!> else 0) {
|
||||
fun case_26(a: Int, b: Int = if (a === null) <!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Int & kotlin.Nothing")!>a<!> else 0) {
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Int")!>a<!>
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Int")!>b<!>
|
||||
}
|
||||
|
||||
@@ -133,10 +133,10 @@ fun case_13(x: Any?) {
|
||||
*/
|
||||
fun case_14(x: Any?) {
|
||||
if (x == null) {
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Any? & kotlin.Any?")!>x<!>
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Any? & kotlin.Any?")!>x<!>?.equals(10)
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Any")!>x!!<!>.equals(10)
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Any? & kotlin.Any")!>x<!>.equals(10)
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Any? & kotlin.Nothing?")!>x<!>
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Any? & kotlin.Nothing?")!>x<!>?.equals(10)
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Nothing")!>x!!<!>.equals(10)
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Any? & kotlin.Nothing")!>x<!>.equals(10)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -147,10 +147,10 @@ fun case_14(x: Any?) {
|
||||
*/
|
||||
fun case_15(x: Any?) {
|
||||
if (x !== null) else {
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Any? & kotlin.Any?")!>x<!>
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Any? & kotlin.Any?")!>x<!>?.equals(10)
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Any")!>x!!<!>.equals(10)
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Any? & kotlin.Any")!>x<!>.equals(10)
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Any? & kotlin.Nothing?")!>x<!>
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Any? & kotlin.Nothing?")!>x<!>?.equals(10)
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Nothing")!>x!!<!>.equals(10)
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Any? & kotlin.Nothing")!>x<!>.equals(10)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@ fun case_1(x: Int?) = x
|
||||
fun case_1() {
|
||||
var x: Int? = 10
|
||||
x = null
|
||||
case_1(<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Int?")!>x<!>)
|
||||
<!OVERLOAD_RESOLUTION_AMBIGUITY!>case_1<!>(<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Int? & kotlin.Nothing?")!>x<!>)
|
||||
}
|
||||
|
||||
// TESTCASE NUMBER: 2
|
||||
@@ -21,7 +21,7 @@ fun case_2(x: Nothing?) = x
|
||||
fun case_2() {
|
||||
var x: Int? = 10
|
||||
x = null
|
||||
case_2(<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Int?")!>x<!>)
|
||||
case_2(<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Int? & kotlin.Nothing?")!>x<!>)
|
||||
}
|
||||
|
||||
// TESTCASE NUMBER: 3
|
||||
@@ -29,7 +29,7 @@ fun case_3(x: String?) = x
|
||||
fun case_3() {
|
||||
var x: Int? = 10
|
||||
x = null
|
||||
case_3(<!ARGUMENT_TYPE_MISMATCH, DEBUG_INFO_EXPRESSION_TYPE("kotlin.Int?")!>x<!>)
|
||||
case_3(<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Int? & kotlin.Nothing?")!>x<!>)
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -42,7 +42,7 @@ fun Int?.case_4() = this
|
||||
fun case_4() {
|
||||
var x: Int? = 10
|
||||
x = null
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Int?")!>x<!>.case_4()
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Int? & kotlin.Nothing?")!>x<!>.<!OVERLOAD_RESOLUTION_AMBIGUITY!>case_4<!>()
|
||||
}
|
||||
|
||||
// TESTCASE NUMBER: 5
|
||||
@@ -51,7 +51,7 @@ fun Nothing?.case_5() = this
|
||||
fun case_5() {
|
||||
var x: Int? = 10
|
||||
x = null
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Int?")!>x<!>.case_5()
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Int? & kotlin.Nothing?")!>x<!>.case_5()
|
||||
}
|
||||
|
||||
// TESTCASE NUMBER: 6
|
||||
@@ -59,7 +59,7 @@ fun String?.case_6() = this
|
||||
fun case_6() {
|
||||
var x: Int? = 10
|
||||
x = null
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Int?")!>x<!>.<!INAPPLICABLE_CANDIDATE!>case_6<!>()
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Int? & kotlin.Nothing?")!>x<!>.case_6()
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -72,7 +72,7 @@ fun <T : Int?> T.case_7() = this
|
||||
fun case_7() {
|
||||
var x: Int? = 10
|
||||
x = null
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Int?")!>x<!>.case_7()
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Int? & kotlin.Nothing?")!>x<!>.<!OVERLOAD_RESOLUTION_AMBIGUITY!>case_7<!>()
|
||||
}
|
||||
|
||||
// TESTCASE NUMBER: 8
|
||||
@@ -81,7 +81,7 @@ fun <T : Nothing?> T.case_8() = this
|
||||
fun case_8() {
|
||||
var x: Int? = 10
|
||||
x = null
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Int?")!>x<!>.case_8()
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Int? & kotlin.Nothing?")!>x<!>.case_8()
|
||||
}
|
||||
|
||||
// TESTCASE NUMBER: 9
|
||||
@@ -89,7 +89,7 @@ fun <T : String?> T.case_9() = this
|
||||
fun case_9() {
|
||||
var x: Int? = 10
|
||||
x = null
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Int?")!>x<!>.<!INAPPLICABLE_CANDIDATE!>case_9<!>()
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Int? & kotlin.Nothing?")!>x<!>.case_9()
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -102,7 +102,7 @@ fun <T : <!FINAL_UPPER_BOUND!>Int<!>> T?.case_10() = this
|
||||
fun case_10() {
|
||||
var x: Int? = 10
|
||||
x = null
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Int?")!>x<!>.case_10()
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Int? & kotlin.Nothing?")!>x<!>.<!OVERLOAD_RESOLUTION_AMBIGUITY!>case_10<!>()
|
||||
}
|
||||
|
||||
// TESTCASE NUMBER: 11
|
||||
@@ -110,5 +110,5 @@ fun <T : <!FINAL_UPPER_BOUND!>String<!>> T?.case_11() = this
|
||||
fun case_11() {
|
||||
var x: Int? = 10
|
||||
x = null
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Int?")!>x<!>.<!INAPPLICABLE_CANDIDATE!>case_11<!>()
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Int? & kotlin.Nothing?")!>x<!>.case_11()
|
||||
}
|
||||
|
||||
@@ -20,7 +20,7 @@ fun case_2() {
|
||||
var x: Int? = 10
|
||||
var y = { x = null }
|
||||
if (x != null) {
|
||||
val z = case_2(<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Int? & kotlin.Int")!>x<!>)
|
||||
val z = case_2(<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Int? & kotlin.Nothing")!>x<!>)
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.String")!>z<!>
|
||||
}
|
||||
}
|
||||
|
||||
@@ -10,7 +10,7 @@ fun case_1() {
|
||||
inner@ do {
|
||||
x = null
|
||||
} while (x == null)
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.String? & kotlin.String")!>x<!>
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.String? & kotlin.String")!>x<!>.length
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.String? & kotlin.Nothing")!>x<!>
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.String? & kotlin.Nothing")!>x<!>.length
|
||||
}
|
||||
}
|
||||
|
||||
@@ -154,7 +154,7 @@ fun case_10(x: Any): String {
|
||||
*/
|
||||
fun case_11(x: Any?): String? {
|
||||
if (x is Nothing?) {
|
||||
return <!NO_ELSE_IN_WHEN!>when<!>(x) {
|
||||
return when(x) {
|
||||
null -> null
|
||||
}
|
||||
}
|
||||
@@ -168,7 +168,7 @@ fun case_11(x: Any?): String? {
|
||||
*/
|
||||
fun case_12(x: Any?): String? {
|
||||
if (x == null) {
|
||||
return <!NO_ELSE_IN_WHEN!>when<!>(x) {
|
||||
return when(x) {
|
||||
null -> null
|
||||
}
|
||||
}
|
||||
@@ -182,7 +182,7 @@ fun case_12(x: Any?): String? {
|
||||
*/
|
||||
fun case_13(x: Any?): String? {
|
||||
if (x === null) {
|
||||
return <!NO_ELSE_IN_WHEN!>when<!>(x) {
|
||||
return when(x) {
|
||||
null -> null
|
||||
}
|
||||
}
|
||||
@@ -196,7 +196,7 @@ fun case_13(x: Any?): String? {
|
||||
*/
|
||||
fun case_14(x: Any?): String? {
|
||||
x as Nothing?
|
||||
return <!NO_ELSE_IN_WHEN!>when<!>(x) {
|
||||
return when(x) {
|
||||
null -> null
|
||||
}
|
||||
}
|
||||
|
||||
@@ -14,8 +14,8 @@ fun case_1(x: Any?) {
|
||||
// TESTCASE NUMBER: 2
|
||||
fun case_2(x: Any?) {
|
||||
(x as Nothing?)!!
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Any? & kotlin.Any?")!>x<!>
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Any? & kotlin.Any?")!>x<!><!UNSAFE_CALL{LT}!>.<!><!UNRESOLVED_REFERENCE!>inv<!>()
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Any? & kotlin.Nothing?")!>x<!>
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Any? & kotlin.Nothing?")!>x<!><!UNSAFE_CALL!>.<!><!UNRESOLVED_REFERENCE{LT}!>inv<!>()
|
||||
}
|
||||
|
||||
// TESTCASE NUMBER: 3
|
||||
@@ -37,8 +37,8 @@ fun case_4(x: Any?) {
|
||||
// TESTCASE NUMBER: 5
|
||||
fun case_5(x: Any?) {
|
||||
if (x as Nothing? is Nothing) {
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Any? & kotlin.Any?")!>x<!>
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Any? & kotlin.Any?")!>x<!><!UNSAFE_CALL{LT}!>.<!><!UNRESOLVED_REFERENCE!>inv<!>()
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Any? & kotlin.Nothing?")!>x<!>
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Any? & kotlin.Nothing?")!>x<!><!UNSAFE_CALL!>.<!><!UNRESOLVED_REFERENCE{LT}!>inv<!>()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -39,7 +39,7 @@ fun case_1(x: Any?) {
|
||||
*/
|
||||
fun case_2(x: Nothing?) {
|
||||
if (x !== null && x !== null) {
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Nothing? & kotlin.Nothing?")!>x<!>
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Nothing?")!>x<!>
|
||||
}
|
||||
}
|
||||
|
||||
@@ -81,16 +81,16 @@ fun case_5() {
|
||||
val x: Unit? = null
|
||||
|
||||
if (x !== null || x !== null && x !== null || x !== null && x !== null) {
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Unit? & kotlin.Unit")!>x<!>
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Unit? & kotlin.Unit")!>x<!>.equals(null)
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Unit? & kotlin.Unit")!>x<!>.propT
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Unit? & kotlin.Unit")!>x<!>.propAny
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Unit? & kotlin.Unit")!>x<!>.propNullableT
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Unit? & kotlin.Unit")!>x<!>.propNullableAny
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Unit? & kotlin.Unit")!>x<!>.funT()
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Unit? & kotlin.Unit")!>x<!>.funAny()
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Unit? & kotlin.Unit")!>x<!>.funNullableT()
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Unit? & kotlin.Unit")!>x<!>.funNullableAny()
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Unit?")!>x<!>
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Unit?")!>x<!><!UNSAFE_CALL!>.<!>equals(null)
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Unit?")!>x<!>.propT
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Unit?")!>x<!><!UNSAFE_CALL!>.<!>propAny
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Unit?")!>x<!>.propNullableT
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Unit?")!>x<!>.propNullableAny
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Unit?")!>x<!>.funT()
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Unit?")!>x<!><!UNSAFE_CALL!>.<!>funAny()
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Unit?")!>x<!>.funNullableT()
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Unit?")!>x<!>.funNullableAny()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -115,7 +115,7 @@ fun case_6(x: Class?) {
|
||||
// TESTCASE NUMBER: 7
|
||||
fun case_7() {
|
||||
val x: EmptyObject? = null
|
||||
if (x != null || x != null || <!DEBUG_INFO_EXPRESSION_TYPE("EmptyObject? & EmptyObject?")!>x<!> != null) {
|
||||
if (x != null || x != null || <!DEBUG_INFO_EXPRESSION_TYPE("EmptyObject? & kotlin.Nothing?")!>x<!> != null) {
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("EmptyObject? & EmptyObject")!>x<!>
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("EmptyObject? & EmptyObject")!>x<!>.equals(null)
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("EmptyObject? & EmptyObject")!>x<!>.propT
|
||||
|
||||
@@ -25,7 +25,7 @@ fun case_2(): Int? {
|
||||
val x: Int? = null
|
||||
return when (x != null) {
|
||||
false -> {
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Int? & kotlin.Int?")!>x<!>
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Int? & kotlin.Nothing?")!>x<!>
|
||||
}
|
||||
else -> null
|
||||
}
|
||||
@@ -53,7 +53,7 @@ fun case_4(): Int? {
|
||||
val x: Int? = null
|
||||
return when (x == null) {
|
||||
true -> {
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Int? & kotlin.Int?")!>x<!>
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Int? & kotlin.Nothing?")!>x<!>
|
||||
}
|
||||
else -> null
|
||||
}
|
||||
|
||||
@@ -57,16 +57,16 @@ fun case_3(a: Inv<Int>?) {
|
||||
if (a != null) {
|
||||
val b = a
|
||||
if (a == null) {
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("Inv<kotlin.Int>? & Inv<kotlin.Int>")!>b<!>
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("Inv<kotlin.Int>? & Inv<kotlin.Int>")!>b<!>.equals(null)
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("Inv<kotlin.Int>? & Inv<kotlin.Int>")!>b<!>.propT
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("Inv<kotlin.Int>? & Inv<kotlin.Int>")!>b<!>.propAny
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("Inv<kotlin.Int>? & Inv<kotlin.Int>")!>b<!>.propNullableT
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("Inv<kotlin.Int>? & Inv<kotlin.Int>")!>b<!>.propNullableAny
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("Inv<kotlin.Int>? & Inv<kotlin.Int>")!>b<!>.funT()
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("Inv<kotlin.Int>? & Inv<kotlin.Int>")!>b<!>.funAny()
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("Inv<kotlin.Int>? & Inv<kotlin.Int>")!>b<!>.funNullableT()
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("Inv<kotlin.Int>? & Inv<kotlin.Int>")!>b<!>.funNullableAny()
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("Inv<kotlin.Int>? & kotlin.Nothing")!>b<!>
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("Inv<kotlin.Int>? & kotlin.Nothing")!>b<!>.equals(null)
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("Inv<kotlin.Int>? & kotlin.Nothing")!>b<!>.propT
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("Inv<kotlin.Int>? & kotlin.Nothing")!>b<!>.propAny
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("Inv<kotlin.Int>? & kotlin.Nothing")!>b<!>.propNullableT
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("Inv<kotlin.Int>? & kotlin.Nothing")!>b<!>.propNullableAny
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("Inv<kotlin.Int>? & kotlin.Nothing")!>b<!>.funT()
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("Inv<kotlin.Int>? & kotlin.Nothing")!>b<!>.funAny()
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("Inv<kotlin.Int>? & kotlin.Nothing")!>b<!>.funNullableT()
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("Inv<kotlin.Int>? & kotlin.Nothing")!>b<!>.funNullableAny()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -61,7 +61,7 @@ fun case_3(a: Inv<out Int>?) {
|
||||
if (a != null) {
|
||||
val b = a
|
||||
if (a == null)
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("Inv<out kotlin.Int>? & Inv<out kotlin.Int>")!>b<!>
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("Inv<out kotlin.Int>? & kotlin.Nothing")!>b<!>
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("Inv<out kotlin.Int>? & Inv<out kotlin.Int>")!>b<!>.equals(null)
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("Inv<out kotlin.Int>? & Inv<out kotlin.Int>")!>b<!>.propT
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("Inv<out kotlin.Int>? & Inv<out kotlin.Int>")!>b<!>.propAny
|
||||
|
||||
Reference in New Issue
Block a user