From 0d3e33acfd06d7cf98a2aa4328969d291beb0214 Mon Sep 17 00:00:00 2001 From: Bartek Pacia Date: Wed, 3 Sep 2025 14:21:56 +0200 Subject: [PATCH] [groovy] TypeLattice: fix fallbacks for join() and meet() GitOrigin-RevId: 7395f5828b5faac9d6f40d0a6e99a9ed2100454d --- .../intentions/style/inference/graph/InferenceGraphUtil.kt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/plugins/groovy/src/org/jetbrains/plugins/groovy/intentions/style/inference/graph/InferenceGraphUtil.kt b/plugins/groovy/src/org/jetbrains/plugins/groovy/intentions/style/inference/graph/InferenceGraphUtil.kt index 1ec9e3345997..8bcaca8f44d1 100644 --- a/plugins/groovy/src/org/jetbrains/plugins/groovy/intentions/style/inference/graph/InferenceGraphUtil.kt +++ b/plugins/groovy/src/org/jetbrains/plugins/groovy/intentions/style/inference/graph/InferenceGraphUtil.kt @@ -168,14 +168,14 @@ private fun PsiType.mapConjuncts(action: (PsiType) -> PsiType): PsiType { private class TypeLattice(context: PsiElement) { private val manager = context.manager private val top = getJavaLangObject(context) as PsiType - private val bottom = PsiTypes.nullType() as PsiType + private val bottom = PsiTypes.nullType() fun join(types: Iterable): PsiType = types.fold(bottom) { accum, type -> - GenericsUtil.getLeastUpperBound(accum, type, manager) ?: bottom + GenericsUtil.getLeastUpperBound(accum, type, manager) ?: top } fun meet(types: Iterable): PsiType = types.fold(top) { accum, type -> - GenericsUtil.getGreatestLowerBound(accum, type) + GenericsUtil.getGreatestLowerBound(accum, type) ?: bottom } }