From f37f1e6d91c9c14c63cea6cbfa74211ddfc0c3d8 Mon Sep 17 00:00:00 2001 From: Ivan Kochurkin Date: Thu, 19 Oct 2023 19:07:02 +0200 Subject: [PATCH] [FIR] Add a comment that explains why `FirErrorTypeRefImpl` is written manually --- .../jetbrains/kotlin/fir/types/impl/FirErrorTypeRefImpl.kt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/compiler/fir/tree/src/org/jetbrains/kotlin/fir/types/impl/FirErrorTypeRefImpl.kt b/compiler/fir/tree/src/org/jetbrains/kotlin/fir/types/impl/FirErrorTypeRefImpl.kt index ca951ce005d..9be6ba178a0 100644 --- a/compiler/fir/tree/src/org/jetbrains/kotlin/fir/types/impl/FirErrorTypeRefImpl.kt +++ b/compiler/fir/tree/src/org/jetbrains/kotlin/fir/types/impl/FirErrorTypeRefImpl.kt @@ -18,6 +18,10 @@ import org.jetbrains.kotlin.fir.visitors.FirTransformer import org.jetbrains.kotlin.fir.visitors.FirVisitor import org.jetbrains.kotlin.fir.visitors.transformInplace +// This class is written manually because is has custom traversal logic that allows to avoid visiting the same nodes twice or more. +// Particularly, it prevents reporting duplicated diagnostics. +// It doesn't touch `delegatedTypeRef` in `acceptChildren` and `transformChildren` functions. +// It doesn't call `transformPartiallyResolvedTypeRef` in `transformChildren` function. internal class FirErrorTypeRefImpl( override val source: KtSourceElement?, override var annotations: MutableOrEmptyList,