Commit Graph

3109 Commits

Author SHA1 Message Date
pyos 6c6d653e85 FE: don't lose annotations on Java primitive arrays
but only use them to enhance for warnings for now.

^KT-48861 Fixed
2022-10-26 09:33:40 +02:00
Mikhail Glukhikh 80fa765333 K1: introduce synthetic assignment checker with deprecation for KT-54305
#KT-54305 Fixed
Related to KT-54309
2022-10-25 12:33:09 +00:00
Ilya Muradyan 8d12342fc6 Add option for skipping calculating all names for optimizing reasons in LazyImportScope 2022-10-20 16:00:42 +02:00
Dmitriy Novozhilov d423782fac [FE 1.0] Remove usages of safeAs and cast from most of FE 1.0 modules:
- :core:descriptors
- :core:descriptors.jvm
- :core:deserialization
- :compiler:cli
- :compiler:frontend
- :compiler:frontend:cfg
- :compiler:frontend.java
- :compiler:frontend.common.jvm
- :compiler:psi
- :compiler:resolution
- :compiler:resolution.common
- :compiler:resolution.common.jvm
- :kotlin-reflect-api
2022-10-12 13:58:56 +00:00
Pavel Mikhailovskii f4bdf54601 KT-8575 Fix warnings for Java synthetic properties 2022-10-10 22:03:58 +00:00
Nikolay Lunyak b6f950ed75 [FIR][FE 1.0] KT-47933: Warn about redundant @Repeatable
Merge-request: KT-MR-7318
Merged-by: Nikolay Lunyak <Nikolay.Lunyak@jetbrains.com>
2022-10-07 13:33:49 +00:00
Hung Nguyen 03f83ff339 New IC: Include inline property accessors in class/package members
Problem: ClasspathChangesComputer (a core component of the new IC) uses
the existing inline function analysis from the old IC
(IncrementalJvmCache.InlineFunctionsMap). If an inline property accessor
has changed, the inline function analysis will report the name of the
property accessor, not the name of the property.
ClasspathChangesComputer doesn't see the property accessor's name in the
list of class/package members, so it will throw an exception.

Solution: There are 2 options:
  1. If an inline property accessor has changed, the inline function
     analysis can report the name of the property instead of the
     property accessor.
  2. ClasspathChangesComputer can include property accessors in the list
     of class/package members.

In this commit, we will choose option 2 as it is simpler.

Test: New KotlinOnlyClasspathChangesComputerTest.testPropertyAccessors

Small cleanup - PLS SQUASH INTO PREVIOUS COMMIT

  - Address review
  - Fix failed tests
  - Add some trivial changes

^KT-53871 Fixed
2022-09-19 11:50:08 +02:00
Mikhail Glukhikh fb9b1ad0dc K1: implement warning for upper bound violated in type alias constructors
Partially implements KT-47473
2022-09-15 08:51:46 +00:00
Mikhail Glukhikh b19832ef9a K1: modify error message of ENUM_DECLARING_CLASS_DEPRECATED
Related to KT-53805
2022-09-12 10:45:23 +00:00
Mikhail Glukhikh 769a2ca9b1 K1: report ENUM_DECLARING_CLASS_DEPRECATED on enum entry properly
#KT-53807 Fixed
2022-09-12 10:45:23 +00:00
Dmitriy Novozhilov 671083c701 [Serialization] Implement serialization checker for K2 version of plugin
^KT-53178 Fixed
2022-09-07 07:57:38 +00:00
Pavel Kirpichenkov 24dcad0d9c [MPP] Use module's type checker for upper bound checks
The default type checker doesn't have a correct type refinement setup.
This can cause false positives in subtyping of upper bounds in edge
cases with expect type arguments.

See the tests in the intellij repo.

KTIJ-22295
2022-09-01 09:51:11 +00:00
Pavel Kirpichenkov 029bb55157 [MPP] Refine scope for synthetic Java properties
Unrefined member scopes might have missing Java supertypes and cause
false positive resolution errors for synthetic properties in IDE.

KTIJ-22345
2022-08-25 09:17:46 +00:00
Dmitry Gridin 4f18e7091b [light classes] analysis-api-fir: migrate from :compiler:backend to :compiler:backend.common.jvm
^KT-53097
2022-08-01 13:56:35 +00:00
Denis.Zharkov 7d6e133c0d Refine warning messages for KT-36770
^KT-36770 Fixed
2022-07-25 16:08:49 +00:00
Denis.Zharkov a3b33901d8 Add issue link to deprecation warning message for KT-36770
^KT-36770 Fixed
2022-07-22 16:42:13 +00:00
Dmitriy Novozhilov af8caae387 [KAPT] Fix formatting 2022-07-20 10:12:25 +00:00
Dmitry Gridin 52e0e744af move JvmFileClassInfo and JvmFileClassUtil to frontend.common.jvm
^KT-53097
2022-07-19 15:41:43 +00:00
Dmitry Gridin 4250d2ac23 move PackagePartClassUtils to frontend.common-psi
^KT-53097
2022-07-19 15:41:40 +00:00
Dmitry Gridin 31b89757f7 [light classes] move JvmDeclarationOriginKind to frontend.common.jvm module
^KT-53097
2022-07-19 15:41:24 +00:00
Pavel Mikhailovskii 846537b367 KT-45375 Lightweight lambdas; KT-52817 introduce @JvmSerializableLambda 2022-07-18 17:10:07 +02:00
Victor Petukhov fb21937eb1 [FE 1.0] Report INVISIBLE_MEMBER on all qualified expressions including safe call ones
^KT-47621 Fixed
2022-07-11 12:44:06 +00:00
Zac Sweers 3896482e4f Fix wrong replacement name for Enum.declaringClass
Resolves https://youtrack.jetbrains.com/issue/KT-52718
2022-06-10 13:53:03 +00:00
Ivan Kylchik 73a571ef7f Report warning from backend if constant expression cannot be evaluated 2022-05-18 21:20:04 +03:00
Ivan Kylchik 40d224d5fe Change error message of EXCEPTION_IN_CONST_VAL_INITIALIZER 2022-05-18 21:20:03 +03:00
Ivan Kylchik 1431d4b356 Add jvm diagnostic tests to check report of exceptions from interpreter 2022-05-18 21:20:00 +03:00
Vladimir Dolzhenko efd5beb49b IJ file type optimizations based on extension
#KTIJ-21668

Merge-request: KT-MR-6288
Merged-by: Vladimir Dolzhenko <Vladimir.Dolzhenko@jetbrains.com>
2022-05-17 14:46:00 +00:00
pyos effd21d074 JVM_IR: do not optimize suspend$$forInline functions
`$$forInline` functions do not pass through the state machine generator,
and optimizing `Ref`s before that changes how assignments inside lambdas
passed to `suspendCoroutine`, etc. behave: without a `Ref`, the
assignment is not reflected in the continuation object, so the variable
has old value on resumption.

These functions will be optimized later, after they are inlined
somewhere and the state machine is generated.

^KT-52198 Fixed
2022-05-02 20:18:08 +02:00
Aleksei.Cherepanov 3d8f140d6b [JPS] Fix incremental build after changing Java enum used in Kotlin when
EnumWhenTracker implemented for tracking changed java enum class items, that used in kotlin when expression.

#KT-47824 Fixed
2022-04-19 18:39:41 +00:00
Denis.Zharkov 9c7fea24d1 Fix exception when reporting WRONG_TYPE_PARAMETER_NULLABILITY_FOR_JAVA_OVERRIDE
^KT-51979 Fixed
2022-04-15 12:36:05 +00:00
Ilmir Usmanov 6e30ce2763 FE: Make synchronized suspend functions and lambdas error in 1.8
#KT-27333 Fixed
2022-04-11 12:02:30 +00:00
Victor Petukhov b5933c70e2 [FE 1.0] Refactor error utils: split error entities and introduce error type and error scope kinds 2022-03-23 21:13:33 +00:00
Vladimir Dolzhenko 289b838d77 [kotlin] Optimize file.fileType calculation
#KTIJ-20095
2022-01-31 08:31:33 +00:00
Mikhail Glukhikh fd3d86eddf FE 1.0: introduce deprecation for Enum.declaringClass (KT-49653) 2022-01-27 17:27:40 +03:00
Denis.Zharkov b2543b7a26 Fix false negative UPPER_BOUND_VIOLATED with typealiases in supertypes
^KT-50797 Fixed
^KT-50798 Open
2022-01-19 09:52:16 +03:00
Mikhail Glukhikh a4f74f60d9 Fix apostrophes in error messages #KT-50183 Fixed 2022-01-14 22:20:23 +03:00
Evgeniy.Zhelenskiy df1de3a7d3 [JVM] Forbid non-JvmInline value classes again 2022-01-14 13:51:56 +00:00
Mikhael Bogdanov 92e893bebe Rework Tune module graph dependencies building
#KT-50701 In progress
2022-01-14 11:22:46 +00:00
Denis.Zharkov d87eddaf8b Improve warnings related to type parameter bounds nullability
Explicitly supply the type parameter that needs to be non-nullified

^KT-36770 Relates
2022-01-13 08:47:20 +03:00
Irene Dea 19bfc43bee Fixes and refactors 2022-01-08 15:25:07 +03:00
Ilya Kirillov 52baf7338e Move KotlinBinaryClassCache to separate module, so it can be used outside FE1.0 2021-12-27 16:23:08 +03:00
Mikhael Bogdanov e5e3e9d326 Advanced modules supports
#KT-29974
2021-12-23 07:25:58 +00:00
Mikhael Bogdanov ae81aaa7b0 Tune module graph dependencies building 2021-12-23 07:25:57 +00:00
Vyacheslav Gerasimov f7a9065b75 Build: Use intellij maven repo instead of downloaded IDEA
#KTI-82
2021-12-16 21:48:23 +03:00
Ilya Chernikov c1c94778ce Detect and report inner classes capturing script instance 2021-12-14 13:39:22 +03:00
Ilya Chernikov 10c5071eda Implement backend error reporting on unsupported script capturing
#KT-30616 fixed
#KT-43995 fixed
#KT-19424 fixed
#KT-49443 fixed
2021-12-14 13:39:17 +03:00
Evgeniy.Zhelenskiy 96334948f0 [Tests] Pass sample test without annotation with flag ValueClasses 2021-12-10 18:19:15 +03:00
Mikhael Bogdanov 7e99ba30f3 Remove obsolete USAGE_OF_JVM_DEFAULT_THROUGH_SUPER_CALL diagnostic
#KT-47000
2021-12-09 11:30:06 +01:00
Dmitry Petrov 50b0dae786 KT-47939 fixes after review 2021-12-08 14:12:37 +03:00
Dmitry Petrov 1fd0dec5e7 FE KT-47939 callable references to functional interface constructors
Allow callable references to Kotlin 'fun interface' constructors.
Prohibit callable references to Java SAM interface constructors.
2021-12-08 14:12:33 +03:00