Commit Graph

72604 Commits

Author SHA1 Message Date
Roman Golyshev 108395fcfe FIR: Fix bug with incorrect source element for qualifiers 2021-02-12 10:53:04 +00:00
Roman Golyshev 1479388bd5 FIR IDE: Refactor AbstractFirShortenRefsTest
- Use `FIR_COMPARISON` directive
- Move testing utils to `ideaFirTestUtils.kt`
- Ignore `TopLevelFunctionImportWithLotsOfFqName.kt` test for now (it
takes too long to execute)
2021-02-12 10:53:04 +00:00
Roman Golyshev 68b5f2736e FIR: Add fake root prefix for IDE resolution 2021-02-12 10:53:03 +00:00
Roman Golyshev 0de251e50d Add runTestInWriteCommand flag to AbstractImportTest 2021-02-12 10:53:02 +00:00
Dmitriy Novozhilov 2d5b685535 [FIR] Fix processing constructors of sealed classes
- Allow declaring protected constructors in sealed classes
- Make default visibility of sealed class constructor `protected`

KT-44861
KT-44865
2021-02-12 13:36:41 +03:00
Dmitriy Novozhilov 7c61ddc72b [FE] Allow declaring protected constructors in sealed classes
#KT-44865 Fixed
2021-02-12 13:36:39 +03:00
Dmitriy Novozhilov f3a8fcaea6 [FE] Make constructors of sealed classes protected instead of internal 2021-02-12 13:36:38 +03:00
Mikhael Bogdanov e795c2c407 Generate proper hashCode for fun interface wrappers
#KT-44875 Fixed
2021-02-12 11:28:17 +01:00
Vyacheslav Karpukhin f33cad54c5 AndroidDependencyResolver: fixed AAR import on modern AGP plugins 2021-02-11 23:24:19 +01:00
Vyacheslav Karpukhin 7eb5fc7778 AndroidDependencyResolver: fixed NPE 2021-02-11 23:24:18 +01:00
Anton Bannykh abc44fa658 Increase -Xmx for Ant tests 2021-02-11 18:39:34 +03:00
Jinseong Jeon 20f9787c70 FIR checker: report errors in contract description 2021-02-11 17:02:18 +03:00
Jinseong Jeon 3d635b6a94 FIR: unwrap smartcast expression when extracting effects of contract 2021-02-11 17:02:16 +03:00
Jinseong Jeon 70f462781a FIR-IDE: add mappings for backing field diagnostics 2021-02-11 17:02:15 +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
Yaroslav Chernyshev 4b62b2de0c Use IDEA ASM in kotlin-gradle-plugin-integration-tests module 2021-02-11 13:25:48 +03:00
Mark Punzalan c3c8991ab6 FIR IDE: Re-organize MainKtQuickFixRegistrar. 2021-02-11 11:11:00 +01:00
Mark Punzalan a9f19c4a45 FIR IDE: Move ChangeVariableMutabilityFix to idea-frontend-independent. 2021-02-11 11:11:00 +01:00
Mark Punzalan 7962224804 FIR IDE: Add quickfix for VAR_OVERRIDDEN_BY_VAL. 2021-02-11 11:11:00 +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
Nikolay Krasko 2c4a6fdb98 Revert "Use IDEA ASM in kapt module"
This reverts commit 903defdf
2021-02-11 01:07:38 +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
Andrey Zinovyev 6eaf0a95ca [KAPT] Fix expected resolve errors in tests (#4105) 2021-02-10 19:40:28 +03:00
Ilya Gorbunov af8061a4dd Remove kotlin-test-multiplatform special dependency handling
#KT-40225
2021-02-10 18:46:23 +03:00
Dmitriy Novozhilov 2cd1aefd5e [FIR-IDE] Add mapping for FirExpression in diagnostics and generate new IDE ones 2021-02-10 17:38:45 +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
Mikhael Bogdanov 903defdf30 Use IDEA ASM in kapt module 2021-02-10 12:23:47 +01:00
Dmitriy Dolovov 154a768a3a [Commonizer] Minor. Remove unused import 2021-02-10 14:18:14 +03:00
Dmitriy Dolovov ac966ad1d2 [Commonizer] Add getParentEntityId() method to CirEntityId 2021-02-10 14:18:14 +03:00
Dmitriy Dolovov 4bab505c3a [Commonizer] Introduce CIR entities for representing various flavors of names
- CirName - simple name
- CirPackageName - fully-qualified name of the package
- CirEntityName - fully-qualified name of some entity, ex: Class, TypeAlias
2021-02-10 14:18:14 +03:00
Dmitriy Dolovov f8c5244a39 [Commonizer] Use CirConstantValue class to represent constant values 2021-02-10 14:18:13 +03:00
Dmitriy Dolovov 25df25ccc6 [Commonizer] Minor. Extract common module names from CommonizerParameters 2021-02-10 14:18:13 +03:00
Dmitriy Dolovov 97000b1285 [Commonizer] Drop CirContainingClassdetails in favor of CirClass entity 2021-02-10 14:18:13 +03:00
Dmitriy Dolovov 054b59198b [Commonizer] Don't keep fqName inside of CirPackageNode 2021-02-10 14:18:13 +03:00
Dmitriy Dolovov 5d19ac16d5 [Commonizer] Drop useless CirPackageNode.moduleName property 2021-02-10 14:18:12 +03:00