From 065c4e19ecc92e8b737f1c80e2725076738113b8 Mon Sep 17 00:00:00 2001 From: Stanislav Erokhin Date: Tue, 21 Jun 2016 18:50:54 +0300 Subject: [PATCH] Add debug info for EA-79267 - (T is not T) assert: TypeCheckingProcedure.checkSubtypeForTheSameConstructor --- .../src/org/jetbrains/kotlin/types/checker/utils.kt | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/core/descriptors/src/org/jetbrains/kotlin/types/checker/utils.kt b/core/descriptors/src/org/jetbrains/kotlin/types/checker/utils.kt index 7b48fdb4cdb..1a2c2ec3688 100644 --- a/core/descriptors/src/org/jetbrains/kotlin/types/checker/utils.kt +++ b/core/descriptors/src/org/jetbrains/kotlin/types/checker/utils.kt @@ -1,5 +1,5 @@ /* - * Copyright 2010-2015 JetBrains s.r.o. + * Copyright 2010-2016 JetBrains s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -16,6 +16,7 @@ package org.jetbrains.kotlin.types.checker +import org.jetbrains.kotlin.renderer.DescriptorRenderer import org.jetbrains.kotlin.resolve.calls.inference.wrapWithCapturingSubstitution import org.jetbrains.kotlin.types.KotlinType import org.jetbrains.kotlin.types.TypeConstructorSubstitution @@ -65,6 +66,13 @@ fun findCorrespondingSupertype( currentPathNode = currentPathNode.previous } + if (!typeCheckingProcedureCallbacks.assertEqualTypeConstructors(substituted.constructor, supertypeConstructor)) { + throw AssertionError("Type constructors should be equals!" + + "substitutedSuperType: ${DescriptorRenderer.FQ_NAMES_IN_TYPES.renderType(substituted)}, " + + "foundSupertype: ${DescriptorRenderer.FQ_NAMES_IN_TYPES.renderType(currentSubtype)}, " + + "supertype: ${DescriptorRenderer.FQ_NAMES_IN_TYPES.renderType(supertype)}") + } + return TypeUtils.makeNullableAsSpecified(substituted, isAnyMarkedNullable) }