Commit Graph

265 Commits

Author SHA1 Message Date
Victor Petukhov 697ef03d57 [FIR] Make FirPlaceholderProjection having source element 2021-11-01 13:03:31 +03:00
Dmitriy Novozhilov 4490f64666 [FIR] Get rid of FirAnnotatedDeclaration
Now all fir declarations have annotations

^KT-49260 Fixed
2021-10-28 15:01:18 +03:00
Ilya Chernikov 5446168770 Add path to FirFile to pass it to the DiagnosticContext 2021-10-27 22:17:40 +02:00
Ilya Chernikov a65beb2dc5 Move Fir*SourceElement to frontend.common, rename to Kt* (complete) 2021-10-27 21:44:11 +02:00
Denis.Zharkov f441024fd4 FIR: Derive FirMemberDeclaration from FirAnnotatedDeclaration
It's necessary to have the sane logic that FirMemberDeclaration is a subtype of FirDeclaration
The only kind of controversial change here is making FirAnonymousObject
also be FirMemberDeclaration, thus having its own declaration status
2021-10-20 22:05:20 +03:00
Mikhail Glukhikh 29e4c299e7 FIR: add & use hasExplicitParameterList to anonymous functions
#KT-49134 Fixed
2021-10-19 11:58:23 +03:00
Tianyu Geng 5ccc5591f5 FIR: add isImplicit to FirThisReceiverExpression 2021-10-05 15:30:40 +03:00
Tianyu Geng 154ceaa89f FIR: Make default visitor only visit single parent 2021-10-01 18:57:35 +03:00
Tianyu Geng 263f6b1fd8 FIR: generate FirDefaultVisitor and FirDefaultVisitorVoid...
so they won't be outdated when FIR class tree is updated.
2021-10-01 18:57:34 +03:00
Tianyu Geng 211544e790 FIR: rename FirResolvedImport.resolvedClassId|relativeClassName
These two fields references the parent of the import rather than the
classes that are imported. For example

```
import java.util.Map // resolvedClassId -> null
import java.util.Map.Entry // resolvedClassId -> java.util.Map
import java.util.Map.* // resolvedClassId -> java.util.Map
import java.util.Map.someStaticMethod // resolvedClassId -> java.util.Map
import kotlin.package.someTopLevelFuntion // resolvedClassId -> null
import kotlin.package.MyObject.someObjectFuntion // resolvedClassId -> kotlin.package.MyObject
```
2021-09-29 22:24:25 +02:00
Dmitriy Novozhilov 31a7d8d5a4 [FIR] Split FirAnnotation into FirAnnotation and FirAnnotationCall
FirAnnotation represents simple annotation placed on some element.
  This element contains only annotation type ref and simple argument
  mapping

FirAnnotationCall is a element for call of annotation (`@Ann(args)`)
  which was written in user code. FirAnnotationCall is a resolvable call
2021-09-13 13:53:11 +03:00
Dmitriy Novozhilov 52e339593e [FIR] Infer name of FIR elements in generator from property name 2021-09-13 13:53:10 +03:00
Dmitriy Novozhilov 4b662a42a1 [FIR] Rename FirAnnotationCall to FirAnnotation 2021-09-13 13:53:09 +03:00
Nikolay Lunyak aefd6c30ad [FIR] Merge FirPropertyFieldDeclarationSymbol into FirBackingFieldSymbol 2021-09-11 22:05:34 +03:00
Nikolay Lunyak b72488b4c2 [FIR] Add replaceGetter & replaceSetter 2021-09-11 22:05:33 +03:00
Nikolay Lunyak ee58df6b3c [FIR] Add FirBackingField 2021-09-11 22:05:29 +03:00
Nikolay Lunyak 654ed3caf6 [FIR] Add propertySymbol to property accessors 2021-09-11 22:05:25 +03:00
Mikhail Glukhikh 19a75b31f9 FIR: avoid resolve loop between accessor and other members
#KT-48634 Fixed
2021-09-08 14:47:51 +03:00
Roman Golyshev 08e9a3bc4f Process FirErrorResolvedQualifiers in KtFirReferenceShortener
Also, add `classId` default value to the `FirErrorResolvedQualifierImpl`
just as in `FirResolvedQualifierImpl` - it seemed inconsistent that
we can have a class symbol in error-resolved qualifier, but the
`classId` field will be `null`
2021-08-27 19:29:14 +03:00
Ivan Kochurkin 8d764fa50e [FIR] Add FirPropertyAccessExpression that inherits FirQualifiedAccessExpression 2021-08-13 20:05:43 +03:00
Ivan Kochurkin 2c1c24c042 [FIR] Implement WRONG_MODIFIER_CONTAINING_DECLARATION, DEPRECATED_MODIFIER_CONTAINING_DECLARATION 2021-08-13 18:32:28 +03:00
Tianyu Geng 4726dcce40 FIR DFA: smartcast variable to Nothing? on null assignment
In order to make resolution still work for members not available from
`Nothing`, we track the type without `Nothing?` and use that for
resolution instead.
2021-08-06 22:57:15 +03:00
Ivan Kochurkin afb85026c4 Revert "[FIR] Implement INVISIBLE_SETTER"
This reverts commit b3d7ed56
2021-08-02 20:10:22 +03:00
Ivan Kochurkin 2fbb700ec6 [FIR] Add nonFatalDiagnostics to FirQualifierAccess 2021-07-30 16:58:05 +00:00
Ivan Kochurkin f5d8535dc5 [FIR] Add aliasSource to FirImport, FirImportImpl 2021-07-30 16:58:04 +00:00
Ivan Kochurkin b3d7ed569d [FIR] Implement INVISIBLE_SETTER 2021-07-30 18:07:34 +03:00
Igor Yakovlev e1c8f302a4 [FIR IDE] Make fir resolve phase volatile and remove locks 2021-07-26 23:08:54 +02:00
Nikolay Lunyak a44048e713 Add withBindThis to field configuration 2021-07-26 16:12:16 +00:00
Andrey Zinovyev 8a0941a85a [FIR] Report deprecations in qualified expressions 2021-07-26 14:50:54 +03:00
Ivan Kochurkin 345152d198 [FIR] Add containingDeclarationSymbol to FirTypeParameter 2021-07-15 19:02:56 +03:00
Ivan Kochurkin 0fc8be4d60 [FIR] Implement OUTER_CLASS_ARGUMENTS_REQUIRED diagnostics 2021-07-15 19:02:40 +03:00
Dmitriy Novozhilov 51fc2e453f [FIR] Unity FirCallableDeclaration and FirCallableMemberDeclaration
After removal of all diamonds in FirDeclaration hierarchy
  FirCallableMemberDeclaration was only one inheritor of
  FirCallableDeclaration, so there is no need to keep them both
2021-07-13 10:31:20 +03:00
Andrey Zinovyev de3f31cf78 [FIR] Partial implementation of DEPRECATION(_ERROR) diagnostics
No support for inheritance deprecations
and deprecations in qualifier's parts
2021-07-07 16:19:28 +03:00
Ilya Kirillov 51576c70b6 FIR: introduce package directive
The package directive is needed for KtElement -> FirElement mapping in IDE.
There should be some FirElement which will be result of mapping of elements
inside KtPackageDirective.
2021-07-06 22:49:50 +03:00
Dmitriy Novozhilov 1593c4859d [FIR] Get rid of all conditional reads of FirDeclaration.resolvePhase 2021-07-04 13:29:03 +03:00
Ivan Kochurkin a7276b25ae [FIR] Add expression field to FirErrorExpression
It is used to report diagnostics even in erroneous code (within ILLEGAL_SELECTOR for instance).
2021-06-29 22:39:22 +03:00
Dmitriy Novozhilov 5816d7ae9f [FIR] Rename FirStatusOwner back to FirMemberDeclaration 2021-06-29 21:03:30 +03:00
Dmitriy Novozhilov f400477c70 [FIR] Remove generic parameter from FirDeclaration 2021-06-29 21:03:30 +03:00
Dmitriy Novozhilov 511e564b20 [FIR] Add specific symbols for value parameters and enum entries
Make FirVariableSymbol a sealed class
2021-06-29 21:03:30 +03:00
Dmitriy Novozhilov 62d781a70f [FIR] Move delegateFieldSymbol from FirVariable to FirProperty 2021-06-29 21:03:30 +03:00
Dmitriy Novozhilov 1324e9223f [FIR] Make FirDeclaration an abstract class 2021-06-29 21:03:28 +03:00
Dmitriy Novozhilov b3e5c6e079 [FIR] Add symbol to all declarations. Get rid of FirSymbolOwner 2021-06-29 21:03:28 +03:00
Dmitriy Novozhilov 39cd1c8504 [FIR] Squash AbstractFirBasedSymbol with FirBasedSymbol 2021-06-29 21:03:28 +03:00
Dmitriy Novozhilov 823cbc59b7 [FIR] Split FirAnonymousFunction to expression and declaration 2021-06-29 21:03:28 +03:00
Dmitriy Novozhilov 85b844c748 [FIR] Split FirAnonymousObject to expression and declaration 2021-06-29 21:03:27 +03:00
Tianyu Geng 2e049c1208 FIR DFA: fix CFG with normal arg after lambda [KT-46825]
The fix is a bit hacky, but it's very simple. In addition, it still does
not handle the case where the receiver is a lambda function. But such
case seems to be fairly rare in practice.
2021-06-29 10:46:41 +03:00
Tianyu Geng a537074e1e FIR: add a boolean tracking if a class ref resolves to the companion object 2021-06-24 18:27:50 +02:00
Tianyu Geng 78401b3ae0 FIR: add helper to check if a smartcast expressioin is stable 2021-06-10 16:01:16 +03:00
Tianyu Geng 2bb7ef9747 FIR DFA: store stability in RealVariable
As part of this change, we also extend the usage of RealVariable in more
places during DFA. Now mutable properties, property with custom getters,
delegated properties, etc are also treatd as a `RealVariable`. In
general this is needed in order to carry out smartcast computation in
order to report `SMARTCAST_IMPOSSIBLE`. It seems to also have side
effects that improves behavior of some test files.
2021-06-10 16:01:11 +03:00
Tianyu Geng 97ea37c82f FIR: add smartcast stability to FIR 2021-06-10 16:01:09 +03:00