FIR IDE: check generated primary constructor
Currently the IDE skips checking the delegated constructor call because the primary constructor is generated if it's declared with the class.
This commit is contained in:
committed by
Ilya Kirillov
parent
2b994e1b66
commit
9bdae40ad8
+9
-4
@@ -173,10 +173,15 @@ internal class NonReanalyzableDeclarationStructureElement(
|
|||||||
firFile,
|
firFile,
|
||||||
onDeclarationEnter = { firDeclaration ->
|
onDeclarationEnter = { firDeclaration ->
|
||||||
when {
|
when {
|
||||||
// Some generated declaration contains structures that we need to check. For example the FIR representation of an
|
firDeclaration.isGeneratedDeclaration -> when {
|
||||||
// enum entry initializer, when present, is a generated anonymous object of kind `ENUM_ENTRY`.
|
// a generated primary constructor need to be checked. For example it may have a delegated super constructor
|
||||||
firDeclaration.isGeneratedDeclaration ->
|
// call or some annotations
|
||||||
DiagnosticCollectorDeclarationAction.DO_NOT_CHECK_IN_CURRENT_DECLARATION_AND_LOOKUP_FOR_NESTED
|
firDeclaration is FirConstructor && firDeclaration.isPrimary ->
|
||||||
|
DiagnosticCollectorDeclarationAction.CHECK_IN_CURRENT_DECLARATION_AND_LOOKUP_FOR_NESTED
|
||||||
|
// Some generated declaration contains structures that we need to check. For example the FIR representation of an
|
||||||
|
// enum entry initializer, when present, is a generated anonymous object of kind `ENUM_ENTRY`.
|
||||||
|
else -> DiagnosticCollectorDeclarationAction.DO_NOT_CHECK_IN_CURRENT_DECLARATION_AND_LOOKUP_FOR_NESTED
|
||||||
|
}
|
||||||
firDeclaration is FirFile -> DiagnosticCollectorDeclarationAction.DO_NOT_CHECK_IN_CURRENT_DECLARATION_AND_LOOKUP_FOR_NESTED
|
firDeclaration is FirFile -> DiagnosticCollectorDeclarationAction.DO_NOT_CHECK_IN_CURRENT_DECLARATION_AND_LOOKUP_FOR_NESTED
|
||||||
firDeclaration == fir -> {
|
firDeclaration == fir -> {
|
||||||
inCurrentDeclaration = true
|
inCurrentDeclaration = true
|
||||||
|
|||||||
Reference in New Issue
Block a user