Commit Graph

1022 Commits

Author SHA1 Message Date
Victor Petukhov 697ef03d57 [FIR] Make FirPlaceholderProjection having source element 2021-11-01 13:03:31 +03:00
Dmitriy Novozhilov 877b53201b [FIR] Prohibit access to members of companion of enum from enum entry initializer
^KT-49110
2021-10-29 18:45:23 +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
Ilya Chernikov c50c8ad270 Move FirSourceElement to frontend.common (only move to save history) 2021-10-27 21:43:15 +02:00
Jinseong Jeon 3f2c86afb8 FIR IDE/LC: introduce/use delegated member scope 2021-10-27 17:06:32 +02:00
Tianyu Geng 9b3add0130 FIR: add pointer from primary constructor param to correspondng property 2021-10-25 18:16:31 +03:00
Tianyu Geng 363b25504d FIR checker: report REDUNDANT_LABEL_WARNING
Since many labels are not present in the FIR tree, this checker is
implemented as a syntax checker. Comparing with FE1.0, this change
reports some REDUNDANT_LABEL_WARNING that FE1.0 has missed, especially
LHS of assignments.
2021-10-25 13:51:01 +03:00
Tianyu Geng cbc9d08623 FIR: [code clean up] force custom hashcode/equals for FirSourceElement 2021-10-25 13:50:59 +03:00
Mikhail Glukhikh 79b98f9173 FIR: introduce synthetic property symbol hierarchy 2021-10-23 01:19:07 +03:00
Mikhail Glukhikh c673c4cc91 FIR: refactor/use properly FirAccessorSymbol & FirSyntheticPropertySymbol 2021-10-23 01:19:06 +03:00
Mikhail Glukhikh 41849c8beb FIR: get rid of effectively unused AccessorSymbol 2021-10-23 01:19:05 +03:00
Mikhail Glukhikh 9515011365 Minor: make when in 'isExtension' a bit more clear 2021-10-21 00:07:50 +03:00
Denis.Zharkov d702365632 Regenerate FIR tree 2021-10-20 22:05:22 +03: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
Tianyu Geng bdc71a3281 FIR IDE: pass candidate super types for AMBIGUOUS_SUPER
This way the IDE quickfix do not need to do resolution again to figure
out what super type to offer in the quickfix.
2021-10-20 19:16:48 +02:00
Mikhail Glukhikh 29e4c299e7 FIR: add & use hasExplicitParameterList to anonymous functions
#KT-49134 Fixed
2021-10-19 11:58:23 +03:00
Mark Punzalan 167dc81d3b FIR/Analysis API: Get parameter name from function type notation or
`@ParameterName` annotation, which is also now added during type
resolution.
2021-10-15 16:19:00 +03:00
Denis.Zharkov 10c5d987d7 FIR: Fix exception on remaining flexible ILT in lambda
^KT-49191 Related
2021-10-14 14:01:49 +03:00
Dmitriy Novozhilov b4d955838e [FIR] Properly use FirContainingNamesAwareScope in all places
Split some delegating scopes to basic and name aware implementations

Also get rid of getContainingCallableNamesIfPresent and
  getContainingClassifierNamesIfPresent functions because they are not
  needed anymore
2021-10-12 17:26:43 +03:00
Dmitriy Novozhilov af6d6ec2b9 [FIR] Properly collect constructors from class in presence of plugins 2021-10-12 17:26:41 +03:00
Dmitriy Novozhilov 9a802e7cd7 [FIR] Return symbols instead of FIR from FirPredicateBasedProvider 2021-10-12 17:26:40 +03:00
Dmitriy Novozhilov 6a14d91dbd [FIR] Change predicate providing API for FIR extensions
Predicate declaration was split into two parts:
- registering any number of predicates which are used in specific extension
- special checks for declaration applicability for each specific extension
2021-10-12 17:26:39 +03:00
Dmitriy Novozhilov b3768a201f [FIR2IR] Create special IrDeclarationOrigin for generated declarations 2021-10-12 17:26:37 +03:00
Dmitriy Novozhilov c60ba51f8f [FIR] Include generated declarations into FIR dump in tests
Also include non root package directive of FirFile to dump
2021-10-12 17:26:34 +03:00
Dmitriy Novozhilov 38877ba842 [FIR] Implement extension for providing additional type attributes 2021-10-12 17:26:32 +03:00
Dmitriy Novozhilov 32709151c3 [FIR] Move base FirExtension infrastructure to :fir:tree module
This is needed for type attribute extension which is used not only
  from :resolve module but also from :(de)serialization modules
2021-10-12 17:26:32 +03:00
Dmitriy Novozhilov 26fa772846 [FIR] Add ability to generate members and nested classifiers for existing classes 2021-10-12 17:26:30 +03:00
Dmitriy Novozhilov 9bfa6c54b8 [FIR] Inherit FirContainingNamesAwareScope from FirScope
This is needed to simplify FirScope hierarchy, because in
  fact all inheritors of `FirContainingNamesAwareScope` were
  inheritors of `FirScope` too
2021-10-12 17:26:29 +03:00
Dmitriy Novozhilov f3a9d70eb6 [FIR] Add ability to generate members and nested classifiers for generated classes 2021-10-12 17:26:29 +03:00
Dmitriy Novozhilov 15abd839ed [FIR] Rewrite algorithm of generating declarations by plugins
Before there was separate global stage which asks extensions
  to generate new declarations. Now it is changed to provider
  like requests, so extensions will decide do they have declarations
  with specific classId/callableId or not
2021-10-12 17:26:26 +03:00
Dmitriy Novozhilov 91624dd841 [FIR] Move call of status transform extensions to FirStatusResolver
It makes more sense to run status transformer extension
  right in status resolve stage, because it reduces
  number of compiler stages
2021-10-12 17:26:21 +03:00
Mikhail Glukhikh 7243d30869 Split property use-site targets during FIR building 2021-10-12 16:22:58 +03:00
Mikhail Glukhikh 2a9a1dbb86 FIR: allow diagnostic collection on default property accessors 2021-10-12 16:22:56 +03:00
Tianyu Geng 5ccc5591f5 FIR: add isImplicit to FirThisReceiverExpression 2021-10-05 15:30:40 +03:00
Tianyu Geng a297ee66d4 FIR: suppress VARIABLE_EXPECTED for error reference 2021-10-05 15:30:39 +03:00
Tianyu Geng c572bf05b5 FIR checker: honor DSL marker annotation on the function type
It seems the original function type gets lost during resolution. Hence
thie change added a custom attribute to recover the original function
type on an anonymous function
2021-10-05 15:30:38 +03:00
Roman Golyshev 9b9c51bc8d [FIR] Fix dispatch receivers on inner classes' constructors
1. Inner class constructor should have its outer class as a dispatch
receiver, since it is necessary for the call. Before it was null
2. Substituted inner class constructor should have its original dispatch
 receiver type with the proper substitution. Before it was set to the
 class itself (since the class was usually passed as a new dispatch
 receiver)

Also, modify FIR renderer, so it properly renders the dispatch receiver
of the constructors
2021-10-05 12:17:08 +00: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 5c716ea979 FIR checker: report NOT_A_FUNCTION_LABEL 2021-10-01 17:21:39 +03:00
Jinseong Jeon c8047f8384 Unify and use names of synthetic members of data class 2021-09-30 19:42:42 +02: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
Roman Golyshev bb2b0107c6 [FIR] Render backing fields by FirRenderer 2021-09-15 18:33:43 +00:00
Dmitriy Novozhilov 37b427c656 [FIR] Combine type attributes in typealias expansion
^KT-48651 Fixed
2021-09-15 17:11:31 +03:00
Denis.Zharkov 0923526162 FIR: Minor. Drop unused getWholeQualifierSourceIfPossible 2021-09-14 19:13:45 +03:00
Dmitriy Novozhilov 5769d42248 [FIR] Fix all usages of annotations due to new FirAnnotation hierarchy 2021-09-13 13:53:12 +03: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