From 81df7645e038315b46f2c47e78e9183ac582dbc9 Mon Sep 17 00:00:00 2001 From: Stanislav Erokhin Date: Thu, 16 Feb 2017 05:32:26 +0300 Subject: [PATCH] Fix potential CCE -- use unwrappedType after instanceof check. --- .../src/org/jetbrains/kotlin/types/CommonSupertypes.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/compiler/frontend/src/org/jetbrains/kotlin/types/CommonSupertypes.java b/compiler/frontend/src/org/jetbrains/kotlin/types/CommonSupertypes.java index 68dc71fb11f..a9443c6d139 100644 --- a/compiler/frontend/src/org/jetbrains/kotlin/types/CommonSupertypes.java +++ b/compiler/frontend/src/org/jetbrains/kotlin/types/CommonSupertypes.java @@ -89,11 +89,11 @@ public class CommonSupertypes { for (KotlinType type : types) { UnwrappedType unwrappedType = type.unwrap(); if (unwrappedType instanceof FlexibleType) { - if (DynamicTypesKt.isDynamic(type)) { - return type; + if (DynamicTypesKt.isDynamic(unwrappedType)) { + return unwrappedType; } hasFlexible = true; - FlexibleType flexibleType = (FlexibleType) type; + FlexibleType flexibleType = (FlexibleType) unwrappedType; upper.add(flexibleType.getUpperBound()); lower.add(flexibleType.getLowerBound()); }