Skip to content

Commit

Permalink
[LL FIR] ContextCollector: support error primary constructor
Browse files Browse the repository at this point in the history
^KT-74632 Fixed
  • Loading branch information
dimonchik0036 authored and Space Team committed Feb 13, 2025
1 parent b319f58 commit e20d1ca
Show file tree
Hide file tree
Showing 5 changed files with 53 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -564,6 +564,10 @@ private class ContextCollectorVisitor(
processList(anonymousObject.superTypeRefs)
}

override fun visitErrorPrimaryConstructor(errorPrimaryConstructor: FirErrorPrimaryConstructor) {
visitConstructor(errorPrimaryConstructor)
}

override fun visitConstructor(constructor: FirConstructor) = withProcessor(constructor) {
dumpContext(constructor, ContextKind.SELF)

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
Tower Data Context:
Element 0
Scope: FirDefaultStarImportingScope
Element 1
Scope: FirExplicitStarImportingScope
Element 2
Scope: FirDefaultSimpleImportingScope
Element 3
Scope: FirDefaultSimpleImportingScope
Element 4
Scope: FirPackageMemberScope
Element 5
Scope: FirExplicitSimpleImportingScope

FILE: [ResolvedTo(IMPORTS)] errorPrimaryConstructor.kt
public abstract [ResolvedTo(STATUS)] interface Temp : <ERROR TYPE REF: Symbol not found for s> {
public [ResolvedTo(BODY_RESOLVE)] error_constructor(): R|Temp| {
super<<ERROR TYPE REF: Symbol not found for s>>()
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
interface Temp : <expr>s</expr> () -> Unit
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
Tower Data Context:
Element 0
Scope: FirDefaultStarImportingScope
Element 1
Scope: FirExplicitStarImportingScope
Element 2
Scope: FirDefaultSimpleImportingScope
Element 3
Scope: FirDefaultSimpleImportingScope
Element 4
Scope: FirPackageMemberScope
Element 5
Scope: FirExplicitSimpleImportingScope

FILE: [ResolvedTo(IMPORTS)] errorPrimaryConstructor.kt
public abstract [ResolvedTo(ANNOTATION_ARGUMENTS)] interface Temp : <ERROR TYPE REF: Symbol not found for s> {
public [ResolvedTo(BODY_RESOLVE)] error_constructor(): R|Temp| {
super<<ERROR TYPE REF: Symbol not found for s>>()
}

}

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit e20d1ca

Please sign in to comment.