Alexander Udalov
357f3184bf
JVM IR: fix the type of IrGetField
...
The `irGetField` utility uses the field's own type as the type of the
resulting expression. But the field's type does not make sense outside
of the place of declaration of the field if it references a generic type
parameter of the containing class. Using this non-sensical generic type
led, for example, to an error in Ieee754 intrinsic (KT-48648).
The type of the expression should be kept as is in
JvmPropertiesLowering, i.e. taken from `expression` which the lowering
is replacing with the field access.
#KT-48648 Fixed
2021-10-12 23:35:17 +02:00
Roman Golyshev
d3e2f9a3f6
[FIR IDE] Fix bug in diagnostics' combining during code generation
2021-10-12 19:21:11 +00:00
Mark Punzalan
4f0b52b653
FIR: Transform annotations on type arguments during body resolve.
2021-10-12 18:56:32 +03:00
Dmitriy Novozhilov
fce6efe412
[FIR] Validate generated member declarations
2021-10-12 17:26:44 +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
5f625f3c16
[FIR] Fail with error if multiple plugins generated classes with same classId
...
In future we can turn this failure to some proper diagnostic
2021-10-12 17:26:42 +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
1cfe4deda9
[FIR] Remove unused methods 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
fc1f2e9c72
[FIR2IR] Run IrGenerationExtensions after fir2ir stage
2021-10-12 17:26:38 +03:00
Dmitriy Novozhilov
b3768a201f
[FIR2IR] Create special IrDeclarationOrigin for generated declarations
2021-10-12 17:26:37 +03:00
Dmitriy Novozhilov
233b9f1242
[FIR] Generate IR for generated FIR declarations
2021-10-12 17:26:37 +03:00
Dmitriy Novozhilov
b454fcc1e0
[FIR] Save IR dumps to .ir.txt files instead of .txt in tests
...
This is needed to avoid clashes between different dumps from different
handlers
2021-10-12 17:26:36 +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
79f1779d89
[FIR] Add methods to collect all class and callable ids from extensions
...
They will be needed for generating IR for all declarations from plugins
2021-10-12 17:26:33 +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
e26cd74b16
[FIR] Fix applying generated supertypes for classes without explicit supertypes
2021-10-12 17:26:31 +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
270962e176
[FIR] Make KotlinScopeProvider a session component
2021-10-12 17:26:27 +03:00
Dmitriy Novozhilov
4f764c28cb
[FIR] Use proper caches in FirDeclaredMemberScopeProvider
2021-10-12 17:26:27 +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
e011ca183d
[FIR] Fix FirPluginAnnotationsResolveTransformer after recent compiler changes
2021-10-12 17:26:22 +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
Dmitriy Novozhilov
6d42914e56
[FIR] Migrate fir plugin prototype tests to new test infrastructure
2021-10-12 17:26:18 +03:00
Dmitriy Novozhilov
48aa063b21
[FIR] Cleanup utils for creating FirTotalResolveProcessor
2021-10-12 17:26:16 +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
Mikhail Glukhikh
39fe457f91
Add test reproducing KT-49087 and KT-49069
2021-10-12 16:22:54 +03:00
Dmitry Petrov
a213dad9ab
JVM_IR add more tests for specialized generics and reification
2021-10-12 15:56:38 +03:00
Dmitry Petrov
005d3b1f6f
JVM_IR pass reified type parameters in indy SAM conversion proxy
2021-10-12 15:56:33 +03:00
Dmitry Petrov
40fe67880b
JVM_IR wrap function into a proxy if indy SAM-conversion becomes valid
2021-10-12 15:56:31 +03:00
Sergej Jaskiewicz
9ee8f1e961
[JS IR] Enable StringTrimLowering for JS IR backend
2021-10-11 15:57:53 +00:00
Ilya Goncharov
b0aefd543a
[JS IR] Fix offsets and add new test
...
[JS IR] Use TypeSubstitutor for full substitution of types
- adding new tests
[JS IR] Commonize context and use in wasm
[JS IR] Add test with receiver with callable reference
[JS IR] Add prerequisites around inlining and callable references
[JS IR] Review fixes
- Add test with bounded type parameter
- Remove redundant casts
- Use offsets for synth function
- Correct traversing
[JS IR] Not use origin for not inlined function reference
[JS IR] Move util into common place
[JS IR] Fix offsets
[JS IR] Add type parameter argument and using value in test
[JS IR] Wrap inlined callable references with reified parameters
[JS IR] Add test on callable reference inlined fun
Merge-request: KT-MR-4722
2021-10-11 09:02:08 +00:00
Artem Kobzar
c9510af2c7
test(KT-47806): add tests for the uncovered behavior for generic companion function extensions.
2021-10-11 08:56:52 +00:00
Ilmir Usmanov
f760cd6736
Make CHECKCAST Object not break tail-call optimization
...
Since CHECKCAST Object does nothing for return value of suspend
function - the function returns references only, this is safe.
#KT-49157 Fixed
2021-10-11 06:40:26 +00:00
Dmitriy Novozhilov
8fd2474b9e
[Test] Generated FIR codegen tests on modern jdk
2021-10-09 17:07:37 +03:00
Dmitriy Novozhilov
63d841247c
[FIR2IR] Properly setup IrClass.sealedSubclasses
2021-10-09 17:07:36 +03:00
Dmitry Petrov
146f0f4904
JVM_IR KT-41214 emit PermittedSubclasses on JDK17+
2021-10-09 17:07:35 +03:00
Artem Kobzar
dca4a8e722
fix(KT-45056, KT-47516): use enum as an IR class instead of enum entity class.
2021-10-08 16:21:49 +00:00
Ivan Kochurkin
3dd8ad3599
[FIR] Fix resolving of local class reference chain ^KT-47135 Fixed
2021-10-08 18:52:21 +03:00
Ivan Kochurkin
cbfe0ac073
[FIR] Coerce first parameter to extension receiver ^KT-46371 Fixed
...
Fix typos
2021-10-08 18:52:20 +03:00
Ivan Kochurkin
cc4dac5bec
[FIR] Fix false positive TYPE_VARIANCE_CONFLICT in nested class ^KT-49078 Fixed
2021-10-08 18:52:19 +03:00
Ivan Kochurkin
6c7c1a7a0d
[FIR] Convert REDUNDANT_MODIFIER, DEPRECATED_MODIFIER_PAIR to warnings ^KT-49073 Fixed
2021-10-08 18:52:18 +03:00
Dmitry Petrov
27860ef008
JVM_IR KT-49136 don't optimize null checks on fields and calls
2021-10-08 08:55:24 +03:00
Denis.Zharkov
1c16f2f8c9
Fix ClassCastException at FirUninitializedEnumChecker
2021-10-07 17:26:29 +03:00
Denis.Zharkov
f5da8957b4
FIR2IR: Support not found dependencies classes
...
^KT-49119 Relates
2021-10-07 17:26:27 +03:00