mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
[groovy] TypeLattice: fix fallbacks for join() and meet()
GitOrigin-RevId: 7395f5828b5faac9d6f40d0a6e99a9ed2100454d
This commit is contained in:
committed by
intellij-monorepo-bot
parent
f9c0d46abd
commit
0d3e33acfd
+3
-3
@@ -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>): PsiType = types.fold(bottom) { accum, type ->
|
||||
GenericsUtil.getLeastUpperBound(accum, type, manager) ?: bottom
|
||||
GenericsUtil.getLeastUpperBound(accum, type, manager) ?: top
|
||||
}
|
||||
|
||||
fun meet(types: Iterable<PsiType>): PsiType = types.fold(top) { accum, type ->
|
||||
GenericsUtil.getGreatestLowerBound(accum, type)
|
||||
GenericsUtil.getGreatestLowerBound(accum, type) ?: bottom
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user