Commit Graph

40110 Commits

Author SHA1 Message Date
Mikhael Bogdanov 41d6f0dca4 Remove ir.tree.impl from build 2022-06-20 11:42:52 +00:00
Mikhael Bogdanov 328160894b Move ir.tree.impl into ir.tree 2022-06-20 11:42:51 +00:00
Mikhail Glukhikh 065e852199 FIR: support more precise diagnostics about parameter names
#KT-52762 Fixed
2022-06-20 11:28:55 +00:00
Mikhail Glukhikh 9fbafc3eb9 Add test for KT-52762 2022-06-20 11:28:55 +00:00
Simon Ogorodnik b7a215334e KT-52409 Report error when using K2 with multi-platform 2022-06-20 10:39:25 +00:00
Igor Yakovlev 270a41a2db [WASM] Remove deprecated usage of externref 2022-06-18 19:12:21 +02:00
Victor Petukhov eb19d39cbf [FE 1.0] Build captured type's supertypes in an alternative way: use own projection type as a first supertype, then supertypes from the corresponding type parameter's upper bounds
The original case provoked forking a constraint system which isn't supported in K1 (K2 only). If the captured type is recursive, then type parameter's upper bounds may break subtyping due to substitution the current captured type again, into a recursive type parameter.

Note that we already have special logic for recursive captured types. See `isTypeVariableAgainstStarProjectionForSelfType`.

^KT-52782 Fixed
2022-06-18 14:04:40 +02:00
Ivan Kochurkin 37ccd85e59 [FIR] Use coneType instead of coneTypeSafe<ConeKotlinType> in checkers and fir2ir 2022-06-17 23:26:21 +00:00
Ivan Kochurkin 02ac6110bd [FIR] Handle more cases of implicit types in FirNoImplicitTypesHandler 2022-06-17 23:26:21 +00:00
Ivan Kochurkin 157eedca43 [FIR2IR] Create IrConst instead of IrGetField for default value param in annotation class, ^KT-52676 Fixed 2022-06-17 23:26:20 +00:00
Ivan Kochurkin ca222b9c31 [FIR] Create error type for FirErrorLoop during initialization 2022-06-17 23:26:20 +00:00
Ivan Kochurkin 1a398e89ec [FIR] Add attributes to ConeErrorType for correct annotations resolving 2022-06-17 23:26:19 +00:00
Ivan Kochurkin 9c67a4bc27 [FIR] Remove not used ConeArgumentTypeMismatchCandidateError 2022-06-17 23:26:19 +00:00
Ivan Kochurkin c3638d2219 [FIR] Remove not used ConeUnsupportedDynamicType 2022-06-17 23:26:19 +00:00
Ivan Kochurkin ffbb23661d [FIR] Report UNSUPPORTED for default value in function type 2022-06-17 23:26:18 +00:00
Ivan Kochurkin a3647bb4ff [FIR] FirRenderer: render annotations for block and resolvedQualifier 2022-06-17 23:26:18 +00:00
Ivan Kochurkin fd2b4fd497 [FIR] Fix false positive USELESS_CAST on stub types, ^KT-50293 Fixed 2022-06-17 23:26:18 +00:00
Ivan Kochurkin 856d14e5f7 [FIR] Don't create unwanted "Should have initializer" elements 2022-06-17 23:26:17 +00:00
Ivan Kochurkin 9d6f88469a [FIR] Use @file:Suppress("DuplicatedCode") for generated fir impl nodes
Get rid of unwanted warnings in IntelliJ
2022-06-17 23:26:17 +00:00
Ivan Kochurkin 0c543d65f3 [FIR] Remove not used FirRedundantLabelChecker 2022-06-17 23:26:17 +00:00
Ivan Kochurkin 9f69ea1786 [FIR] Add TYPECHECKER_HAS_RUN_INTO_RECURSIVE_PROBLEM diagnostics, ^KT-52327 Fixed 2022-06-17 23:26:16 +00:00
Ivan Kochurkin c5648fd449 [FIR] Pass annotations to buildResolvedQualifierForClass 2022-06-17 23:26:16 +00:00
Ivan Kochurkin 1ac4d68433 [FIR] Initialize annotations for block for LightTree 2022-06-17 23:26:16 +00:00
Ivan Kochurkin 34b5ce21a1 [FIR] Fix WRONG_ANNOTATION_TARGET for annotation for block, ^KT-52175 Fixed 2022-06-17 23:26:15 +00:00
Ivan Kochurkin b573532d8c Introduce COMPONENT_FUNCTION_NAME_PREFIX constant 2022-06-17 23:26:15 +00:00
Alexander Udalov a52017a130 Rewrite light analysis mode test class filter
Instead of filtering local/synthetic classes based on ClassDescriptor
instances, do it by interpreting kotlin.Metadata. This is needed to
enable these tests for JVM IR, where descriptors are not available in
this way.
2022-06-17 16:51:06 +02:00
Alexander Udalov 448cba07bb Psi2ir: do not generate init block body in kapt mode 2022-06-17 16:51:06 +02:00
Alexander Udalov 7e9d7c895a Kapt: add flag kapt.use.jvm.ir for enabling JVM IR support
#KT-49682
2022-06-17 16:51:06 +02:00
Alexander Udalov 65c7a7f939 Minor, remove obsolete abstract test classes 2022-06-17 16:51:05 +02:00
Mikhail Glukhikh 6a3be0d8ac Add test for KT-52338 (fixed together with KT-49507) 2022-06-17 13:45:57 +00:00
Alexander Udalov 2a9fd47755 Minor, update JVM target versions in -Xjdk-release help 2022-06-17 10:40:35 +00:00
Dmitriy Novozhilov 1a5b6a1bde [FIR2IR] Minor fixes in Fir2IrPluginContext 2022-06-17 09:38:19 +00:00
Dmitriy Novozhilov f7e0880c34 [IR] Mark methods with descriptors of SymbolTable with @ObsoleteDescriptorBasedAPI 2022-06-17 09:38:18 +00:00
Ilya Chernikov c2316ca305 Scripting: avoid definitions discovery when compiling regular kotlin
If only regular kotlin .kt (and .java) files are compiled, do not
register file extensions that may come from discovered script
definitions. Since the discovery is lazy by itself, this should
skip jars processing for regular compilation scenarios without scripts.
#KT-47816 fixed
2022-06-16 21:28:07 +00:00
Ilya Chernikov 5caf2a2aca Scripting: refactor plugin command line processing
- process command line properly when plugin is autoloaded
- add and fix options to disable definitions autoloading and discovery
- cleanup unused code
(partial test is added to "avoid definitions discovery" commit)
2022-06-16 21:28:07 +00:00
Ilya Chernikov a8c4ea04c8 Scripting: add check for 'kotlin' package similar to the regular sources
#KT-52598 fixed
2022-06-16 21:28:06 +00:00
Ilya Chernikov f5950ac8f3 minor: avoid double reporting of scripting diagnostics
also fix arror reporting for scripts with location
2022-06-16 21:28:06 +00:00
Ilya Chernikov 855059b93c Scripting: update scripts in source roots handling
#KT-52525 fixed
related to #KT-52735
2022-06-16 21:28:06 +00:00
Ilya Chernikov bffe94e48a minor: simplify dependencies of setIdeaIoUseFallback
since kotlin needs now jvm 8 or above, we can drop the checks
2022-06-16 21:28:05 +00:00
Ilya Chernikov 597677dae3 Scripting: refactor history handling in legacy REPL using new infra
#KT-47187 fixed
2022-06-16 21:28:03 +00:00
Ilya Chernikov 92bf260057 Scripting: Implement conditional conversion for REPL result values
to support value types erased from runtime classes. See example
in added tests for motivation.
#KT-45065 fixed
also refactor launcher repl test and result type rendering
2022-06-16 21:28:03 +00:00
Ilya Chernikov b36d1be5f8 Scripting: switch legacy CLI REPL to the new infrastructure 2022-06-16 21:28:02 +00:00
Jinseong Jeon a2da690afd Test: add java source files as JavaSourceRoot
so that those can be properly populated in SingleJavaRootsIndex
2022-06-16 22:14:17 +02:00
Yan Zhulanow 191bac38a3 Fix 'PsiElement.getReference()' contract for Kotlin PSI (KT-52822)
As stated in JavaDoc for 'PsiElement' (formatting is slightly changed):

Returns the reference from this PSI element to another PSI element
(or elements), if one exists. If the element has multiple associated
references, returns the first associated reference.
2022-06-16 18:31:49 +00:00
Dmitriy Novozhilov c79a485c8e [FIR2IR] Run IrGenerationExtensions before patching parents of external declarations and constant evaluation
^KT-52804 Fixed
2022-06-16 13:43:50 +00:00
Dmitriy Novozhilov 76622097e4 [IR] Introduce new functions for referencing declarations from IrPluginContext
Those functions take `ClassId` and `CallableId`, which is more correct
  than using just `FqName`.

Also implement those functions for `Fir2IrPluginContext`
2022-06-16 13:43:50 +00:00
Dmitriy Novozhilov a30216c655 [IR] Mark methods with descriptors of ReferenceSymbolTable with @ObsoleteDescriptorBasedAPI
Also remove optIn annotation from IrPluginContext.symbolTable
2022-06-16 13:43:49 +00:00
Sergej Jaskiewicz da7ff5b868 [JS IR] Fix replacing super.toString() call with a runtime function call
#KT-52553 Fixed
2022-06-16 10:03:14 +00:00
Sergej Jaskiewicz 53233c487e [JS] Factor out source map path rewriting 2022-06-16 10:02:05 +00:00
Sergej Jaskiewicz 0320d49ddc [JS IR] Generate sourcemaps for JS IR tests 2022-06-16 10:02:04 +00:00