Jinseong Jeon
3d635b6a94
FIR: unwrap smartcast expression when extracting effects of contract
2021-02-11 17:02:16 +03:00
Alexander Udalov
510b9e6f2a
Move around some codegen box tests
...
In tests merged from boxAgainstJava in 29b96aa1 , some directories were
named slightly differently compared to box, e.g. "property" vs
"properties", "varargs" vs "vararg". This change renames these, moves
some of the tests to more fitting directories, and also renames
"visibility" to "javaVisibility" because it's about Java visibilities
specifically.
2021-02-11 13:50:09 +01:00
Alexander Udalov
2d60fa787d
Remove codegen tests on old language and API versions
2021-02-11 13:50:09 +01:00
Alexander Udalov
401f0ac583
Use TARGET_BACKEND instead of DONT_TARGET_EXACT_BACKEND in box against Java tests
...
"// TARGET_BACKEND: JVM" more clearly says that the test is
JVM-specific, rather than DONT_TARGET_EXACT_BACKEND which excludes all
other backends.
2021-02-11 13:50:08 +01:00
Victor Petukhov
f797ee7803
Substitute captured types with inner intersection one (NewTypeSubstitutor)
...
^KT-44651 Fixed
2021-02-11 14:20:14 +03:00
Alexander Udalov
80daf120e6
Apply illegal-access=permit workaround for JDK 16+
...
Apparently, the openjdk commit that enabled JEP 396 (encapsulated JDK
defaults) is effective since jdk-16+28:
https://github.com/openjdk/jdk/commit/ed4c4ee7
2021-02-11 12:12:39 +01:00
Mikhail Glukhikh
57e06992c9
Skip JDK 6 in failing BB test (java.util.function in use)
2021-02-11 12:59:23 +03:00
Mikhail Glukhikh
cd483ad231
FIR2IR: fix raw SAM conversion (avoid * in type arguments)
2021-02-11 11:48:35 +03:00
Mikhail Glukhikh
5f3102bf2f
FIR2IR: expand type before getting nullability #KT-44803 Fixed
2021-02-11 11:48:35 +03:00
Mikhail Glukhikh
791f589127
SymbolTable: Rewrite nasty code with if without else in elvis RHS
2021-02-11 11:48:34 +03:00
Mikhail Glukhikh
4bc630d82c
FIR2IR: enhance approximation of captured types
2021-02-11 11:48:34 +03:00
Mikhail Glukhikh
346ffb3acf
FIR2IR: support substitution for SAM types
2021-02-11 11:48:34 +03:00
Mikhail Glukhikh
7050af9b79
FIR2IR: use invariant projections for SAM_CONVERSION types
2021-02-11 11:48:34 +03:00
Roman Artemev
67671afab4
[Plugin API] Fix missed call in resolveBySignatureInModule
2021-02-11 11:44:09 +03:00
Alexander Udalov
73aa465ee9
Add tests for issues fixed in JVM IR
...
Note that KT-30696 is fixed only in the single-module case, and KT-42012
is not fixed fully (see KT-44855).
#KT-30041
#KT-30629
#KT-30696
#KT-30933
#KT-32351
#KT-32749
#KT-38849
#KT-42012
#KT-42990
#KT-44234
#KT-44529
#KT-44631
#KT-44647
2021-02-10 21:42:10 +01:00
Yaroslav Chernyshev
17fc10a8af
Mark obsolete Gradle JVM options as Deprecated with Error
...
Options `includeRuntime`, `noStdlib` and `noReflect` were affected
#Fixed KT-44361
2021-02-10 21:21:03 +03:00
Jinseong Jeon
9b1f01ab04
FIR checker: differentiate unsafe infix/operator calls from UNSAFE_CALL
2021-02-10 17:38:45 +03:00
Jinseong Jeon
1729eff31b
FIR checker: reincarnate FIR source child lookup utils
...
This is a partial revert of commit 94ddb71213
2021-02-10 17:38:44 +03:00
Jinseong Jeon
5e150d62ea
FIR checker: differentiate UNSAFE_IMPLICIT_INVOKE_CALL from UNSAFE_CALL
2021-02-10 17:38:44 +03:00
Dmitriy Novozhilov
0c0c53cc2e
[FE] Don't analyze members with CLASSIFIERS kind filter in AbstractLazyMemberScope
...
This commit introduces partial support of descriptorKindFilter in
`AbstractPsiBasedDeclarationProvider`. Without it there may be an error
in following case:
```
sealed class Base
class Derived : Base()
class Test<out V>(val x: Base) {
private val y = when (x) {
is Derived -> null
}
}
```
Here we start to resolve type of `y`, then go to computation of inheritors
of sealed class Base, which also may be inside Test, so we need get all
nested classifiers in Test. But without this filtration we will start
computing descriptor for `y` again, which leads to ReenteringLazyComputationException
#KT-44316 Fixed
2021-02-10 16:56:49 +03:00
Dmitriy Novozhilov
671ebc6819
[FIR] Fix detecting that if in then branch of outer if used as expression
2021-02-10 14:17:38 +03:00
Alexander Udalov
e6588ee8a4
CLI: include META-INF/services/ from kotlin-reflect with -include-runtime
...
This is an addition to bd205317aa where we
started to add the contents of kotlin-reflect into the resulting jar if
-include-runtime is specified. Apparently kotlin-reflect doesn't work
without some services in META-INF/services/, which didn't satisfy the
condition for inclusion. The existing test didn't catch that because
loading class annotations does not always lead to those services being
loaded.
2021-02-10 12:05:36 +01:00
Alexander Udalov
3dfd2a95fa
Minor, do not output "Not changed" for generated FIR checkers on each build
2021-02-10 12:04:40 +01:00
Dmitriy Novozhilov
1216b33593
[Test] Move extracting JVM_TARGET to provideConfigurationKeys
2021-02-10 13:02:07 +03:00
Dmitriy Novozhilov
606ae45f5f
[Test] Replace remaining KOTLIN_CONFIGURATION_FLAGS directives with specific ones
2021-02-10 13:02:06 +03:00
Dmitriy Novozhilov
3ee5665746
Parse compiler configuration for android tests using new test infrastructure
2021-02-10 13:02:05 +03:00
Dmitriy Novozhilov
a0007bf244
Add analysisFlags of LanguageVersionSettings to toString() method
2021-02-10 13:02:04 +03:00
Dmitriy Novozhilov
7e59e083d3
[Test] Make some functions of environment configurators public
...
This is needed for using those methods from android tests
2021-02-10 13:02:03 +03:00
Dmitriy Novozhilov
24d6853ead
[Test] Cleanup JvmEnvironmentConfigurator
2021-02-10 13:02:01 +03:00
Dmitriy Novozhilov
a932f69b8a
[Test] Don't pass MockProject to environment configurators
2021-02-10 13:02:00 +03:00
Jinseong Jeon
bd37badf29
FIR checker: add diagnostics for backing fields
2021-02-10 12:29:34 +03:00
Mikhail Glukhikh
a88b82d8ff
Rewrite nasty code with if without else in elvis RHS
2021-02-10 12:19:59 +03:00
Dmitry Petrov
d0f26abd18
JVM_IR KT-44798 don't generate multiple stubs with same signature
2021-02-10 09:09:28 +03:00
Mikhael Bogdanov
2673261b10
Use proper jvmArgs syntax, remove -FailOverToOldVerifier from last configurations
...
`FailOverToOldVerifier` support is removed from JDK 16
2021-02-09 18:51:26 +01:00
Ilya Kirillov
c54354f348
FIR: fix memory leak from ConeIntegerLiteralTypeImpl via static NUMBER_TYPE
...
ConeClassLikeType has a cachedExpanded type which has a strong ref to FirSession
2021-02-09 17:15:46 +01:00
Ilya Kirillov
5cefad1ab3
FIR: use GeneratorsFileUtil for checkers-component-generator
2021-02-09 17:15:38 +01:00
Ilya Kirillov
4cf863e054
FIR: simplify PositioningStrategy checkers generator
2021-02-09 17:15:38 +01:00
Ilya Kirillov
21ac83aba0
FIR: rename Diagnostic to DiagnosticData in checkers generators to avoid conflict with existing Diagnostic class
2021-02-09 17:15:37 +01:00
Ilya Kirillov
b2d51dc455
FIR: Update diagnostics list after rebase
2021-02-09 17:15:34 +01:00
Ilya Kirillov
e008ad03a2
FIR: add groups to diagnostics DSL
2021-02-09 17:15:11 +01:00
Ilya Kirillov
15ff79830f
FIR: remove existingN diagnostic creation functions
2021-02-09 17:14:24 +01:00
Ilya Kirillov
b92dce9be4
FIR: introduce DSL to generate diagnostics list
...
this is needed to generate diagnostic list for IDE
2021-02-09 17:14:22 +01:00
Ilya Kirillov
5ff816127a
FIR: extract ConeDiagnostic -> FirDiagnostic to fun to use in IDE code
2021-02-09 17:14:21 +01:00
Dmitriy Novozhilov
6dd331d7e8
[FIR] Add tests for non exhaustive when as last expression of lambda
...
KT-44810
2021-02-09 16:04:42 +03:00
Dmitriy Novozhilov
e54f31cc2f
[IR] Remove useless init block from IrLazyFunction
...
This block was accidentally added in aaa3fa58 in debug purposes
2021-02-09 16:04:42 +03:00
Dmitriy Novozhilov
8f0e1035fa
[FIR] Rename KEY and VALUE generics of FirCache to K and V
2021-02-09 16:04:42 +03:00
Dmitriy Novozhilov
d7e3e83251
[FIR] Update testdata of FIR spec tests
2021-02-09 16:04:41 +03:00
Dmitriy Novozhilov
18bde2c542
[FIR] Reimplement when exhaustiveness checker to fir it's logic with FE 1.0
2021-02-09 16:04:41 +03:00
Dmitriy Novozhilov
2a1c9283a4
[FIR] Add useful util extensions for cone type
2021-02-09 16:04:41 +03:00
Dmitriy Novozhilov
ad677046a8
[FIR] Replace isExhaustive flag with ExhaustivenessStatus object
2021-02-09 16:04:40 +03:00