Commit Graph

91510 Commits

Author SHA1 Message Date
Roman Golyshev ffcbc583d0 FIR: Split EnvironmentConfigurator to an interface and abstract class
It is needed to make it easier to write wrappers for configurators
2022-02-25 23:08:26 +03:00
Roman Golyshev 1a77643ad0 FIR IDE: Add static implementation of KotlinAnnotationsResolver 2022-02-25 23:08:26 +03:00
Roman Golyshev f700b87f6c FIR: Prevent registering compiler plugins twice 2022-02-25 23:08:25 +03:00
Roman Golyshev 62f0487efa FIR: Set resolve phase to BODY_RESOLVE for the generated declarations
In the future it should be checked that plugins can return only
`BODY_RESOLVE`d declarations
2022-02-25 23:08:25 +03:00
Roman Golyshev 765af5f18a FIR IDE: Register plugins-related session components in IDE session
Move registering CLI-specific plugin-related components to
`registerCliCompilerOnlyComponents`
2022-02-25 23:08:25 +03:00
Roman Golyshev 8d9d46dae3 FIR IDE: Lift extensions registration higher in session creation process
We want to do that before creating symbol providers
2022-02-25 23:08:25 +03:00
Roman Golyshev b1b99e1673 FIR IDE: Add the simplest support for PLUGIN KtDeclarationOrigin 2022-02-25 23:08:25 +03:00
Roman Golyshev 6d6a3fbe21 FIR IDE: Consider generated names in KtFirPackageScope
If scope doesn't return generated names from `getPossibleCallableNames`,
it's impossible to query them from the scope, since you have to know the
name of callable/classifier to query it
2022-02-25 23:08:25 +03:00
Roman Golyshev 13cc0ddf97 FIR: Implement FirIdePredicateBasedProvider 2022-02-25 23:08:25 +03:00
Roman Golyshev 08b6353431 FIR: Add IDE implementation for FirRegisteredPluginAnnotations
It works on `KotlinAnnotationsResolver`, which means that it uses
PSI indices to search for the annotations
2022-02-25 23:08:25 +03:00
Roman Golyshev 76707afc90 FIR: Add KotlinAnnotationsResolver service 2022-02-25 23:08:25 +03:00
Roman Golyshev 029331c23b FIR: Introduce AbstractFirRegisteredPluginAnnotations
It will be needed to implement an alternative implementation of this
service
2022-02-25 23:08:25 +03:00
Yahor Berdnikau d62c70298a Disable javadoc generation on local development
Currently Dokka tasks running for Gradle plugins take quite a lot of
time slowing down local development cycle.

This change disables publishing javadoc on non-CI builds. This could be
lifted by putting 'kotlin.build.gradle.publish.javadocs=true' into
local.properties.

^KT-49227 In Progress
2022-02-25 15:21:48 +00:00
Ilya Kirillov 4a5aee688e FIR LC: fix invalid type param upper bound 2022-02-25 14:06:05 +01:00
Ivan Kochurkin e010f59560 Move JSPECIFY_ANNOTATIONS_PACKAGE to 1.8 2022-02-25 11:46:28 +00:00
Ivan Kochurkin c03886ecda Move IgnoreNullabilityForErasedValueParameters to 1.8 2022-02-25 11:46:27 +00:00
Mikhail Glukhikh 53d6ac24e5 Switch kotlin version to 1.7
* Change 1.6 to 1.7 constants
* Fix SAFE_CALL_WILL_CHANGE_NULLABILITY for testData
* Change EXPOSED_PROPERTY_TYPE_IN_CONSTRUCTOR_WARNING to EXPOSED_PROPERTY_TYPE_IN_CONSTRUCTOR_ERROR
* Change NON_EXHAUSTIVE_WHEN_STATEMENT to NO_ELSE_IN_WHEN
* Fix testData for SafeCallsAreAlwaysNullable
* Change T -> T & Any in test dumps
* Change INVALID_CHARACTERS_NATIVE_WARNING -> INVALID_CHARACTERS_NATIVE_ERROR
* TYPECHECKER_HAS_RUN_INTO_RECURSIVE_PROBLEM_WARNING -> TYPECHECKER_HAS_RUN_INTO_RECURSIVE_PROBLEM_ERROR
2022-02-25 11:46:27 +00:00
Yan Zhulanow d741aaf82f Fix pattern for filtering out services in compiler-tests-for-ide
The original pattern wasn't enough for matching all files in the
'META-INF/services' directory, especially the 'TestExecutionListener'
service registration that breaks tearDown() in JUnit5 tests in IDE.
2022-02-25 19:48:17 +09:00
Dmitry Petrov a1db077af9 JVM_IR KT-51458 fix DNN types handling in JvmStringConcatenationLowering 2022-02-25 10:09:14 +03:00
Roman Golyshev f1f2c7cce5 FIR IDE: Small fixes 2022-02-25 01:54:25 +03:00
Igor Yakovlev f0f94623f4 [WASM] Implement data class hashCode and toString for arrays 2022-02-24 20:15:15 +03:00
Vyacheslav Gerasimov 8a20df1a97 Build: Remove allowUntrustedServer & allowInsecureProtocol
#KTI-791
2022-02-24 19:54:00 +03:00
Jinseong Jeon 1b276a3c59 AA: allow enum generated declarations for psi retrieval 2022-02-24 17:51:51 +01:00
Jinseong Jeon 1b6ded6005 FIR/LC: create synthetic members of enum class
^KTIJ-17414 In Progress
^KTIJ-17444 In Progress
2022-02-24 17:51:50 +01:00
Jinseong Jeon 790f2d13ae RAW FIR: record non-null value parameter of Enum#valueOf upfront 2022-02-24 17:51:50 +01:00
Jinseong Jeon 476e65f934 Utilize MemberScope.findFirstFunction with name and predicate 2022-02-24 17:51:49 +01:00
Jinseong Jeon 26e7fc9da3 FIR LC: avoid hardcoded annotation name 2022-02-24 17:51:49 +01:00
Jinseong Jeon 2599c1dbb6 FIR: use StandardNames (instead of hardcoded constants) 2022-02-24 17:51:48 +01:00
Jinseong Jeon 3651c4984a PSI2IR: use StandardNames (instead of hardcoded constants) 2022-02-24 17:51:48 +01:00
Jinseong Jeon f49a42895f FIR LC: use StandardNames (instead of hardcoded constants) 2022-02-24 17:51:47 +01:00
Alexander Udalov b443848ea0 Fix type table serialization in DescriptorSerializer
Always serialize type table (and version requirement table) after
everything else, to prevent bugs like KT-51446 where inline class
underlying type was added to the type table after it has already been
serialized.

 #KT-51446 Fixed
2022-02-24 16:34:25 +01:00
Alexander Udalov c53d91bae1 JVM IR: adjust generation of linenumber for try-finally
Do not generate linenumber for the start of the finally block, because
that is usually where the only word 'finally' is located. Instead,
generate linenumber for the first expression inside the finally block.

Not generating this linenumber fixes an issue in code coverage tools
which would consider such finally uncovered. Although this might be
technically considered as designed, it makes more sense to NOT detect it
as uncovered because semantics of the finally block shouldn't really
differ whether it's executed normally or because an exception happened.
It's also beneficial for the tool support to behave like javac, which
doesn't generate the linenumber either.

 #KT-50973 Fixed
2022-02-24 16:33:40 +01:00
Igor Chevdar 838743bf07 [box-tests] Ignored test for K/N
It will fail in Kotlin 1.7
2022-02-24 15:20:14 +03:00
Igor Chevdar 46f448b5d1 [K/N][tests] Fixed ObjC invalid identifiers test
Some identifiers will be invalid in Kotlin 1.7
2022-02-24 15:20:14 +03:00
Igor Chevdar d51eb32c62 [IR] Fixed IrType.classifierOrNull
Supported IrDefinitelyNotNullType explicitly for now
(later it will be better to handle it at the call sites)

Co-authored-by: Svyatoslav Scherbina <svyatoslav.scherbina@jetbrains.com>
2022-02-24 15:20:13 +03:00
Dmitry Petrov 287d988301 JVM minor simplification in CCE 2022-02-24 10:06:48 +00:00
Dmitry Petrov 872b81ac8a JVM prune exception edges in DFA in some cases 2022-02-24 10:06:47 +00:00
Sergey Bogolepov 817f9f13b7 [K/N] Drop androidNativeActivity sample
This sample uses custom API that is not supported and documented.
Thus, it creates wrong impression on how to use Kotlin/Native for NDK.
2022-02-23 17:25:47 +00:00
Sergey Bogolepov 2ecde3e831 [K/N] Enable AndroidProgramType.Standalone by default
^KT-49144 fixed.
2022-02-23 17:25:47 +00:00
Dmitriy Novozhilov faba9c4272 [CLI] Don't register classpath roots twice
There are two ways how content roots are registered in compiler configuration
  in JVM CLI compiler:
1. Directly from arguments
2. From Module, which build from arguments

And there was a problem that both ways used at the same time in some
  circumstances (regular compilation without .xml module file) which
  caused duplication of all content roots.

Ideal solution for this problem is removal of Module usages at all,
  because it looks like redundant abstraction which just complicate
  things, but it's too scary to remove it, because it hove some none
  trivial usages inside compiler. So to fix problem with duplicated
  roots this commit just removes registration of roots from arguments
  if Module is used
2022-02-23 19:33:51 +03:00
Egor 6d1fe3a962 Fixing merge of script fragments + UT 2022-02-23 18:58:29 +03:00
Ivan Kochurkin f751f13c4d [FIR] Fix incompatible KClass<Any> and callable reference Collection::class, ^KT-51272 Fixed 2022-02-23 14:21:59 +03:00
Ivan Kochurkin 31d9313c51 [FIR] Fix "Expected some types" exception, ^KT-51274 Fixed 2022-02-23 14:21:59 +03:00
Ivan Kochurkin 6a3b7a9f91 [FIR] Ignore fake functions in FirExposedVisibilityDeclarationChecker ^KT-51229 Fixed 2022-02-23 14:21:58 +03:00
Ivan Kochurkin 73b45a1254 [FIR] Report UNSUPPORTED on array literals not from annotation classes ^KT-50750 Fixed 2022-02-23 14:21:57 +03:00
Ivan Kochurkin 19285d0569 [FIR] Fix false positive EXPOSED_PARAMETER_TYPE on internal val in constructor of sealed class ^KT-51200 Fixed 2022-02-23 14:21:57 +03:00
Artem Kobzar 9c5c31bdcb build: change the logic for building ts files before js tests run. 2022-02-23 10:28:02 +00:00
Dmitry Gridin 261cac7514 [light classes] avoid resolve in equals
^KTIJ-21209
2022-02-23 11:13:44 +07:00
Ilmir Usmanov 8811f62300 Fix mapping of nullable generic underlying types of inline classes
#KT-32162 Fixed
2022-02-23 01:23:07 +03:00
Mikhail Glukhikh 981f8b1871 FIR: implement resolve of unqualified enum references in when
See KT-16768
2022-02-22 22:13:06 +03:00