Commit Graph

307 Commits

Author SHA1 Message Date
Vladimir Dolzhenko 3e99807436 Add ability to provide specific AbsentDescriptorHandler
#EA-457188

Merge-request: KT-MR-8900
Merged-by: Vladimir Dolzhenko <Vladimir.Dolzhenko@jetbrains.com>
2023-02-22 12:44:46 +00:00
Yahor Berdnikau 0cad069522 [Build] Pin api and language level to 1.8 in Kotlin compiler modules used by KGP
This is required to be able to compile KGP and it's dependencies which
set LV to 1.4 when repo will use LV 1.9. This caused by the change how
enums are compiled (KT-48872).
2023-02-18 13:26:54 +00:00
Dmitriy Novozhilov a9248569a6 [FIR] Fix reporting of UNINITIALIZED_ENUM_ENTRY in init blocks
^KT-41126 Fixed
2023-02-10 12:30:12 +00:00
Dmitriy Novozhilov bd26c29229 [FIR] Resolve arguments of error types during type resolution 2023-01-12 17:45:06 +00:00
Dmitriy Novozhilov aaf0a1f396 [FIR] Introduce shouldNotBeCalled utility function 2022-12-01 07:29:38 +00:00
Dmitriy Novozhilov 01c6c7dc59 [FIR] Properly approximate return type of callable declarations
- approximate intersection types in all non-local declarations
- approximate local types in non-private non-local declarations
2022-11-22 15:46:20 +00:00
Dmitriy Novozhilov 9b63dde1c3 Add error-level OptIn on safeAs, cast and assertedCast functions in addToStdlib
Usage of this function is unsafe because it does not have native compiler
  support. This means that compiler won't report UNCHECKED_CAST,
  CAST_NEVER_SUCCEED or similar diagnostics in case of error cast
  (which can happen immediately or after some refactoring of class hierarchy)
2022-10-06 06:57:07 +00:00
Abduqodiri Qurbonzoda 34e50649e8 Switch JVM target of the standard libraries to 1.8 #KT-51907 2022-08-13 01:33:45 +03:00
mcpiroman 529c03ab08 Switch to auto generated IR tree
Co-authored-by: Alexander Udalov <alexander.udalov@jetbrains.com>
2022-06-13 18:58:05 +02:00
Yahor Berdnikau af6f17c243 Unify kotlinCompilerClasspath for all projects
This will prevent spawning second Kotlin daemon during compilation
except 'buildSrc' compilation. Original change was introduced in
2e515f3945 commit.
2022-05-24 07:58:38 +00:00
Alexander Udalov 2e515f3945 Prohibit JVM target 1.6
But still compile stdlib, reflect, kotlin.test and scripting runtimes
with JVM target 1.6 to simplify migration from Kotlin 1.6 to 1.7.

 #KT-45165 Fixed
2022-04-19 22:54:40 +02:00
Dmitriy Novozhilov 6f64aedaf0 [FIR] Fix FindReferencePositioningStrategy for light tree
There was a problem which causes to lookup for assign token inside
  functions from arguments of call
2022-03-11 15:36:05 +03:00
Dmitriy Novozhilov ccb74b6477 [FIR] Fix computing compatibility of expect and actual modality 2022-02-18 17:44:39 +03:00
Stanislav Erokhin 1326ca674e Introduced IDEAPluginsCompatibilityAPI and returned some API
Please read the description of IDEAPluginsCompatibilityAPI.
Also, you may notice, that Deprecation annotation was removed.
That is because with level ERROR it isn't possible to opt-in
to such API in the legit cases. And with level WARNING it won't be
reported because We have diagnostic with level ERROR about OptIn marker.
Sadly, there is no way to add ReplaceWith to the OptIn marker
2022-01-13 18:03:07 +01:00
Denis.Zharkov a33d9df0cd NI: Support forking inference with heuristics
Mostly, it only affects FIR

It partially allows to consider several variance of constraints like
A<Int> & A<T> <: A<X_var> that are mostly brought by smart casts

^KT-49542 Fixed
^KT-50489 Relates
2022-01-11 20:45:55 +03:00
Ilya Kirillov 25fe14b514 Move PerformanceCounter to runtime utils, so it can be used outside FE1.0 2021-12-27 16:23:07 +03:00
Dmitriy Novozhilov cb0705ec03 [FIR] Change scheme of generating declarations by plugins
Methods `needToGenerateAdditionalMembersInClass` and
  `needToGenerateNestedClassifiersInClass` are removed, now compiler
  uses `get...Names` and `getTopLevel...` methods to determine which
  extension may generate declaration with specific classId/callableId

This is needed to simplify API of FirDeclarationGenerationExtension and
  provide guarantee that `generate...` method will be called with
  specific classId/callableId only if specific extensions returned name
  for this id from `getName...` functions
2021-11-23 15:01:28 +03:00
Denis.Zharkov 019001ca20 Optimize memory footprint related to empty/single element collections
^KT-47926 Related
2021-08-30 16:51:55 +03:00
Ilya Kirillov c17a4a5a3b FIR IDE: move light classes to separate module 2021-08-24 20:13:09 +03:00
Alexander Udalov 0a9498f7e2 Build: suppress deprecated JVM target warning globally
There seems to be no point in configuring the compiler argument per
project. This argument will be deleted soon anyway, when we remove
support for JDK 1.6 & 1.7.

Also remove `disableDeprecatedJvmTargetWarning`. It didn't have any
effect in all modules where it was applied because these modules
reassign `freeCompilerArgs` anyway, with
`-Xsuppress-deprecated-jvm-target-warning` in it.
2021-07-27 13:35:39 +02:00
Dmitriy Novozhilov 8e0793091a Add @NoInfer to safeAs type
This change will force specify type argument of every safeAs call
2021-07-12 10:11:36 +03:00
Victor Petukhov 18384788a4 Move type enhancement state stuff into core:descriptors.jvm 2021-07-06 09:54:29 +03:00
Victor Petukhov 8de05691a9 Revert "Move fqname related stuff into core:util.runtime module"
This reverts commit e651e1c6
2021-07-06 09:54:28 +03:00
Victor Petukhov ea901d81fb Get rid of redundant Jsr305State 2021-07-06 09:54:28 +03:00
Victor Petukhov f46dc713d7 Support rxjava 3 nullability annotations 2021-07-06 09:54:28 +03:00
Victor Petukhov 61c2f1b203 Extract building JSR-305 settings to separate function 2021-07-06 09:54:27 +03:00
Victor Petukhov e16033f8d8 Add androidx recently nullability annotations 2021-07-06 09:54:26 +03:00
Victor Petukhov d5180f79aa Support picking settings of exacter annotations by the length of the matching part of fqname 2021-07-06 09:54:25 +03:00
Victor Petukhov 46d0b16142 Use new default settings for java nullability annotations in JavaTypeEnhancementState and get rid of all hardcoded defaults 2021-07-06 09:54:24 +03:00
Victor Petukhov 8e7c0e8c61 Describe default settings for java nullability annotations depending on current kotlin version 2021-07-06 09:54:24 +03:00
Victor Petukhov 205087cae3 Move fqname related stuff into core:util.runtime module 2021-07-06 09:54:23 +03:00
Victor Petukhov c8af1b735f Introduce compiler flag to manage status of specific Java nullability annotations 2021-07-06 09:54:23 +03:00
Yahor Berdnikau 7789054547 Migrate repo to use JVM toolchains Gradle feature.
^KT-46972 Fixed
2021-07-05 14:11:12 +00:00
Dmitriy Novozhilov e5b7cf23d6 Drop min functions from addToStdlib.kt 2021-05-14 14:30:20 +03:00
Dmitriy Novozhilov d114913cd2 Replace usages of addToStdlib.firstNotNullResult with firstNotNullOfOrNull 2021-05-14 14:30:19 +03:00
Abduqodiri Qurbonzoda 40d1849f33 Migrate compiler, idea and others to new case conversion api 2021-04-08 03:22:02 +03:00
Ilya Kirillov e41ad2ea06 FIR IDE: implement generators for IDE diagnostics 2021-02-09 17:14:23 +01:00
Alexander Udalov e0b6d4d917 Add -Xsuppress-deprecated-jvm-target-warning to modules compiled with 1.6
Currently this leads to an unknown argument warning, but it'll be
removed automatically on the next bootstrap.
2021-02-03 12:51:39 +01:00
Ilya Chernikov 02c617468f Add support for a callback on recursion for memoized functions 2020-12-21 09:43:43 +01:00
Victor Petukhov 2685c7efce Jspecify: Rename codeanalysis annotations to jspecify ones 2020-10-08 14:00:10 +03:00
Denis Zharkov f3a490ee16 Support compiler flag -Xcodeanalysis-annotations 2020-10-08 14:00:09 +03:00
Denis Zharkov 6c37574fce Rename Jsr305State -> JavaTypeEnhancementState
Also, rename some of the properties
It's needed to store status for codeanalysis annotation in that class
2020-10-08 14:00:08 +03:00
Alexander Udalov 243db689af Build: fix "unknown enum constant" warning on Nls.Capitalization
#KTI-88 Fixed
2020-09-25 22:17:10 +02:00
Dmitriy Novozhilov ca031f7ace [FIR] Split ResolveUtils.kt from :resolve to separate files 2020-09-01 12:00:10 +03:00
Dmitriy Novozhilov e5e3d7cab1 Extract FE 1.0 related parts from NewConstraintSystem 2020-08-28 10:59:50 +03:00
Alexander Udalov a21f273570 Fix compiler warnings in compiler code 2020-08-17 21:18:20 +02:00
Nikita Bobko c5398e8317 Move 'radixPrefix' from compiler modules to IDE modules
`radixPrefix` is used only in IDE now. So let's put it into IDE modules.

This commit is done in order to be able to use code dependent on
`radixPrefix` in `kotlin-ide` repo, because `kotlin-ide` depends on
1.4.0 artifacts of compiler. And `radixPrefix` isn't presented in
those artifacts
2020-08-05 20:17:17 +03:00
Roman Golyshev be06c51aa7 KT-40363 Handle non-octal int literals in for-loop conversions
- See EA-210233
- ^KT-40363 Fixed
2020-07-23 11:24:48 +00:00
Dmitriy Novozhilov 3f5db6b86e [FIR] Add ConeAttributes to ConeKotlinType
(cherry picked from commit f76befa84e)
2020-06-29 12:19:00 +03:00
Vladimir Dolzhenko ab20b3e083 Add InterruptedException handler to CancellableSimpleLock
#EA-220650 Fixed
2020-06-29 08:47:53 +00:00