Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update fir-basics.md #5343

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions docs/fir/fir-basics.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ generated and written with all possible members explicitly declared, so they are
The main way to get some declaration inside compiler is [FirSymbolProvider](https://github.com/JetBrains/kotlin/blob/master/compiler/fir/providers/src/org/jetbrains/kotlin/fir/resolve/providers/FirSymbolProvider.kt)
and [FirScope](https://github.com/JetBrains/kotlin/blob/master/compiler/fir/tree/src/org/jetbrains/kotlin/fir/scopes/FirScope.kt).

_Symbol provider_ is used to lookup for classes by their [ClassId](https://github.com/JetBrains/kotlin/blob/mastercore/compiler.common/src/org/jetbrains/kotlin/name/ClassId.java) and top-level functions and properties by
_Symbol provider_ is used to lookup for classes by their [ClassId](https://github.com/JetBrains/kotlin/blob/master/core/compiler.common/src/org/jetbrains/kotlin/name/ClassId.kt) and top-level functions and properties by
their [CallableId](https://github.com/JetBrains/kotlin/blob/master/core/compiler.common/src/org/jetbrains/kotlin/name/CallableId.kt).
The main symbol provider is a composition of multiple symbol providers, each of them looks up for declaration in specific scopes:
- In sources of current modules,
Expand All @@ -104,4 +104,4 @@ val returnType = functionSymbol.fir.returnTypeRef as FirResolvedTypeRef
```

Please don't forget to make sure that you are in the correct compiler phase which can guarantee that required declaration parts are resolved. For example, it's illegal to access resolved return type of some function in `STATUS` stage, because at this point of time implicit return types are not
resolved. Implicit types are resolved at `IMPLICIT_TYPES_BODY_RESOLVE` phase.
resolved. Implicit types are resolved at `IMPLICIT_TYPES_BODY_RESOLVE` phase.