Mikhail Glukhikh
7cfec0d846
FIR2IR: find & use delegate-to members properly
2021-12-06 18:07:18 +03:00
Mikhail Glukhikh
a919351d07
FIR2IR: change delegate field type to initializer type
2021-12-06 18:07:18 +03:00
Mikhail Glukhikh
49bb2a578e
FIR2IR: delay generation of delegated member bodies
...
Before this commit, we generated delegated member bodies eagerly
at the moment when delegated member itself was generated.
However, in fact delegated member may access e.g. fake override inside
its body, so to work properly, we must delay body generation.
2021-12-06 18:07:17 +03:00
Mikhail Glukhikh
85240bdb06
FIR2IR: generate type arguments in delegation calls
2021-12-06 18:07:17 +03:00
Dmitry Petrov
7206c06d26
IR KT-50039 don't initialize outer 'this' in delegating constructor
2021-12-06 17:31:37 +03:00
Dmitriy Novozhilov
df2e9e3797
[FE 1.0] Correctly set USED_AS_EXPRESSION for unreachable when and if blocks
...
^KT-50028 Fixed
2021-12-06 17:24:06 +03:00
Dmitriy Novozhilov
7bcd3c7948
[FIR] Add FirExtensionRegistrarAdapter to fix extension points in FE 1.0 IDE plugin
...
FirExtensionRegistrar is FIR specific extension which requires FIR
classes to work, which are missing in dependencies of FE 1.0 IDE plugin.
To fix this issue FirExtensionRegistrarAdapter is introduced. This
class is a base class for FirExtensionRegistrar and it does not have
any FIR specific classes in it's API, so it can be safely registered
in IDE
2021-12-06 17:19:34 +03:00
Mikhael Bogdanov
a2395ec8bb
Additional diagnostics for @JvmDefaultWithCompatibility
2021-12-06 14:20:25 +01:00
Mikhael Bogdanov
a1262a4ecd
Rename JVM default flags
2021-12-06 14:20:25 +01:00
Mikhael Bogdanov
ea58c858d1
JvmDefault. Support @JvmDefaultWithCompatibility annotation
...
#KT-48217 Fixed
2021-12-06 14:20:24 +01:00
Tianyu Geng
58067e0a1e
FIR checker: carry original candidate in ConeDiagnosticWithCandidates
...
This is needed by IDE when resolving calls because candidates carry more
information than just the targeting symbol.
2021-12-06 12:40:42 +01:00
Tianyu Geng
b2e1dfa6db
FIR checker: set source for assign call for augmented array set call
...
The source is set on the alternative block but not the XXXAssign call.
BTW, the real source is incorrect shared among the FirAugmentedArraySetCall,
FirBlock, so this change uses a fake source for the FirBlock and the
FirFunctionCall. Using fake source does not seem to be necessary for
compilable code because in that case FirAugmentedArraySetCall is
transformed to either a FirBlock or a FirFunctionCall. But it's needed
for ambiguous code where such transformation fails. In this case, all
three FirElements are present and they should not share the same real
source.
In addition, this change also sets a fake source for the `get` call of
the array access to the left hand side of the operator. For example,
`m[a] += 1` where `m` is some custom map implementation that does not
return `null` from `get`. The (fake) source of the synthetic `get` call
in FIR is now `m[a]`. This is handy because the analysis API will
resolve `m[a]` to the `get` call.
2021-12-06 12:40:42 +01:00
Ilya Gorbunov
9c90d4e471
KT-50033 Add missing public API packages to module-info and setup a test
...
The test checks that new packages are not accidentally non-exported,
so each new stdlib package must be either exported or specified in that
test's expected non-exported package list.
2021-12-06 00:58:51 +00:00
Anton Bannykh
8c558fb6ba
[JS IR] fix compilation
2021-12-05 15:38:04 +03:00
Anton Bannykh
53fe540884
[JS IR] use correct factory for new IR2JS
2021-12-05 15:38:04 +03:00
Anton Bannykh
038514ed65
[JS IR] fix IC (KT-49878 fixed)
2021-12-05 15:38:04 +03:00
Anton Bannykh
bca9f19c86
[JS IR] enable new Ir2JS by default
2021-12-05 15:38:04 +03:00
Anastasiya Shadrina
4d3035e2f7
[Parser] Do not support local contextual declarations
2021-12-03 20:22:17 +03:00
Dmitriy Novozhilov
1f0b62b25f
[FIR] Add smartcasts from == if equals is from Any
...
^KT-49127 Fixed
2021-12-03 14:19:25 +03:00
Dmitriy Novozhilov
ac718cd1c4
[FIR] Move resolvedStatus from FirRegularClassSymbol to FirClassSymbol
2021-12-03 14:19:22 +03:00
Dmitriy Novozhilov
8fcb525d75
[Test] Add ability to mute IC tests via fail.txt file
...
If fail.txt is present in root directory of test then exception from
test will be muted. If there were no exceptions and fail.txt exists
then test fail with suggestion to remove fail.txt
Content of fail.txt does not matter, so it can be used to store
information about why this test doesn't pass
2021-12-03 14:17:41 +03:00
Dmitriy Novozhilov
8c11ea266a
[FIR] Enable plugin phases if some extensions are registered
2021-12-03 14:17:39 +03:00
Dmitriy Novozhilov
86404b8027
[FIR] Implement IR body generators for all FIR declarations generators in plugin prototype
2021-12-03 14:17:34 +03:00
Dmitriy Novozhilov
9a0e73e132
[FIR] Fix IR file entries for files with generated declarations
2021-12-03 14:17:32 +03:00
Anton Bannykh
7b5fbb2985
[IR] add a TODO for the privateSignature
2021-12-03 12:58:25 +03:00
Anton Bannykh
4de69fb4b5
[JS IR] store signatures for private symbols separately from public
...
Those signatures are used in JS IR IC
2021-12-03 12:58:24 +03:00
Anton Bannykh
cb3538db92
Revert "[IR] support storing signatures for non-public symbols"
...
This reverts commit 33cd7e982c .
2021-12-03 12:58:24 +03:00
Mikhael Bogdanov
0997207c7c
Apply -Xjvm-default for specific modules only
2021-12-03 06:39:38 +01:00
Mikhael Bogdanov
c0ffbe03c6
Remove '-Xjvm-default-allow-non-default-inheritance' flag. Enable such inheritance by default
...
#KT-47000 Fixed
2021-12-03 06:39:38 +01:00
Ilya Kirillov
19dec92247
Analysis API: rework declaration renderer
...
- refactor code to use PrettyPrinter instead of ad-hoc one
- do not print nested local declarations as this does not seem to have use-cases
2021-12-02 20:09:18 +01:00
Ilya Kirillov
673459580c
Analysis API: introduce annotation value for KClass
2021-12-02 20:09:16 +01:00
Ilya Kirillov
f722a54c78
Analysis API: separate constant values from annotation values
2021-12-02 20:09:16 +01:00
Anastasiya Shadrina
2d088196ce
[FE] Fill DESCRIPTOR_TO_CONTEXT_RECEIVER_MAP only with CR enabled
2021-12-02 20:25:06 +03:00
Anastasiya Shadrina
9e2271399e
[FE] Render context receivers for functions, properties, and classes
2021-12-02 20:25:05 +03:00
Anastasiya Shadrina
a70f2893c6
[BE] Report if there are CR labels during InlineCodegen
2021-12-02 20:25:01 +03:00
Anastasiya Shadrina
2b30c1eb5d
[FE] Do not change original semantics in LabelResolver
2021-12-02 20:25:00 +03:00
Anastasiya Shadrina
5d76f979cf
[Tests] Minor: add FIR_IDENTICAL to typeParameterAsContextReceiver.kt
2021-12-02 20:24:59 +03:00
Anastasiya Shadrina
a70036c945
[Tests] Add a test with type parameter as a context receiver
2021-12-02 20:24:58 +03:00
Anastasiya Shadrina
752bc299f1
[FE, Tests] Passing context(A, B) where context(B, A) expected
2021-12-02 20:24:56 +03:00
Anastasiya Shadrina
08570a37b8
[PSI2IR] Check how contextual functional type works with IR
2021-12-02 20:24:56 +03:00
Anastasiya Shadrina
a59b9e78ac
[PSI2IR] Numeric promotion doesn't involve context receivers
2021-12-02 20:24:54 +03:00
Anastasiya Shadrina
a760865767
[PSI2IR] Generate safe calls correctly
2021-12-02 20:24:54 +03:00
Anastasiya Shadrina
229a009828
[PSI2IR] Revert synthetic property accessor call adjustment do can't have CR
2021-12-02 20:24:53 +03:00
Anastasiya Shadrina
7a86b4f20a
[PSI2IR] Synthetic property accessor call adjustment do can't have CR
2021-12-02 20:24:52 +03:00
Anastasiya Shadrina
4d0eb74d79
[Tests] Make sure desugaring works with context receivers
2021-12-02 20:24:52 +03:00
Anastasiya Shadrina
0bfea4fc52
[IR, Tests] Fix functionalType sample
2021-12-02 20:24:51 +03:00
Anastasiya Shadrina
bd4e51f304
[FE, PSI2IR] Pass context receivers when calling typealias constructor
2021-12-02 20:24:50 +03:00
Anastasiya Shadrina
fb99df235e
[Tests] Regenerate tests after rebase
2021-12-02 20:24:49 +03:00
Anastasiya Shadrina
6f2b1ecb09
[Tests] Specify custom LF in AbstractVersionRequirementTest
2021-12-02 20:24:48 +03:00
Anastasiya Shadrina
2e97e78e6a
[Tests] Add tests with default params and suspending contextual function
2021-12-02 20:24:48 +03:00