Commit Graph

2968 Commits

Author SHA1 Message Date
Victor Petukhov 731e3ebae1 Rename LV ImprovementsAroundTypeEnhancement into TypeEnhancementImprovementsInStrictMode 2021-03-26 11:03:49 +03:00
Ilya Chernikov 3e458a1efb FIR: Add IncrementalPackagePartsProvider usage in cli...
also refactor IncrementalPackagePartsProvider and parents to simplify
usage
2021-03-24 21:24:18 +01:00
Victor Petukhov 80ac62864d Don't lose inference session in all the possible locations 2021-03-24 15:57:47 +03:00
Ilmir Usmanov 164e9034d1 IC MPP: Allow expect value classes without @JvmInline
#KT-45525 Fixed
2021-03-22 11:13:13 +00:00
Ilmir Usmanov a90a5f6dd4 Check for backend when checking for suspend in fun interfaces 2021-03-16 22:37:44 +01:00
Alexander Udalov bc5fc122c5 JVM, JVM IR: report error if not all parts of multifile class are @JvmSynthetic
#KT-41884 Fixed
2021-03-11 13:33:25 +01:00
Mikhael Bogdanov 4d51d71699 Fix EXPLICIT_OVERRIDE_REQUIRED_IN_MIXED_MODE message 2021-03-08 17:52:52 +00:00
Mikhael Bogdanov 3568eba1b2 Use actual implementation instead of inherited one in -Xjvm-default diagnostics 2021-03-08 17:52:52 +00:00
Mikhael Bogdanov 71c134e54f Fix checker for -Xjvm-defaults 2021-03-08 17:52:51 +00:00
Alexander Udalov 9970851684 Restore writing bytecode version to metadata for LV < 1.5
#KT-45323 Fixed
2021-03-08 11:18:54 +01:00
Andrey Zinovyev b128577508 [KAPT] Some optimizations for stubs generation
* Add index to resolve compiled class by name
* Disable full property resolution
2021-03-03 12:05:49 +03:00
Vladimir Dolzhenko 81efdab4e4 Do not swallow any exceptions apart FNFE
Relates to #KT-39776
2021-02-24 11:06:49 +00:00
Vladimir Dolzhenko b8d1bbdd0d Do not swallow PCE
#KT-39776 Fixed
2021-02-19 15:04:45 +00:00
Victor Petukhov ad9fd7ecf3 KotlinBinaryClassCache: clean-up request caches for all threads
^KT-44550 Fixed
2021-02-18 17:05:59 +03:00
Alexander Udalov 3432f581cb Remove compiler support for kotlin-annotations-android
#KT-44815
2021-02-15 17:23:44 +01:00
Victor Petukhov 0d40022d6d Add reporting of the warnings based on Java annotations for expanded type aliases
Before that, such warnings weren't reported as the corresponding errors were reported during type inference (only original types took part there)
2021-02-15 12:13:55 +03:00
Victor Petukhov d783d99443 Use upper bound checker for typealias expansion 2021-02-15 12:13:53 +03:00
Victor Petukhov befe8599c4 Report warnings or errors for violated type parameter's upper bounds from Java annotated with nullability annotations
^KT-43262 Fixed
2021-02-15 12:13:50 +03:00
Victor Petukhov a94086224d Clear request cache properly during disposing component 2021-02-15 11:13:11 +03:00
Alexander Udalov adfa8c788c Light classes: use JVM target from the module
Using "JVM_1_8" always resulted in incorrect mapping of Kotlin
annotation targets to Java element types.

The change in AbstractKotlinRenderLogTest is needed because while
CliTraceHolder.module is technically a descriptor leak, it was never
detected by this test accidentally, because of the depth cutoff equal to
10, which started to not be enough after the minor refactoring of
replacing `Delegates.notNull` with `lateinit`.
2021-02-01 11:54:05 +01:00
Victor Petukhov 670f029bdf Allow passing non-spread arrays into a vararg parameter after sam properly, through propagating vararg element type to a sam adapter from the original parameter descriptor 2021-01-28 13:19:31 +03:00
Pavel Kirpichenkov c0dd731818 Load JVM built-ins in IDE from module dependencies
Fix built-ins for JVM platform and make them consistent
with module's dependency on standard library. Changes
don't affect non-JVM platforms.

Previously all built-ins in IDE were loaded from classloader
and were based on the same pre-serialized .kotlin_builtins files.
This approach is generally not correct as built-in declarations
differ for different platforms, but it had been working for a while
without immediately observalble effects (see KT-33233 for more info).
After changes in standard library JvmBuiltins started producing
false errors (see KT-39728).

To fix this, JVM built-ins in IDE now utilize the same technique as
applied in CLI: using dependency on standard library as a module
for built-ins instead of artificial module that considers only
.kotlin_builtins.

Change summary:
- Provide JvmBuiltins with kind FROM_DEPENDENCIES
  for all modules with stdlib dependency in IDE
- Add JvmBuiltinsPackageFragmentProvider to JVM-ish module resolvers
  (JVM and Composite with JVM platform) to support their use as
  built-ins module
- Create KotlinBuiltInsMetadataIndex file index for tracking libraries
  containing .kotlin_builtins to support JvmBuiltinsPackageFragmentProvider
- Create KotlinStdlibIndex file index for tracking kotlin-stdlib(-common),
  which looks for "Kotlin-Runtime-Component" manifest attribute
- Add caching service to track LibraryInfo for kotlin-stdlib(-common)
- Put LibraryInfo for kotlin-stdlib(-common) alongside SDKs
  due to the need to resolve that modules in BuiltInsCache
- Update BuiltInsCache to separate JvmBuiltins by module's dependency
  on stdlib and JDK
- Make platform of KotlinSDK common instead of JVM
- Set built-ins module lazily in IDE

^KT-33233 Verification Pending
2021-01-14 17:28:15 +03:00
Dmitry Savvinov 1479c7a270 Minor: load FALLBACK built-ins in JvmPlatformAnalyzerServices
It doesn't matter because this built-ins instance will be used only to
get names of default imports, so nothing can be resolved to those
built-ins => no diagnostics will be reported
2021-01-14 17:28:15 +03:00
Victor Petukhov 27dd9484ba Add missed type arguments for a star projection into the enhanced type arguments list 2020-12-29 11:31:16 +03:00
Denis.Zharkov 5a8dc00a0d Rename JvmBuiltInsSettings -> JvmBuiltInsCustomizer 2020-12-24 14:06:19 +03:00
Victor Petukhov 9a52863fbd Report warnings about type mismatches based on freshly supported nullability annotations deeply 2020-12-18 19:32:05 +03:00
Victor Petukhov 9693ea19fb Add tests for type enhancement uncluding with compiled java 2020-12-18 19:32:05 +03:00
Victor Petukhov 6f8f531d87 Put type enhancement improvements under the compiler flag 2020-12-18 19:32:05 +03:00
Simon Ogorodnik 9bf2dfaa02 KT-40200: Fix main function detector in lazy resolve overload resolver 2020-12-18 14:19:56 +03:00
Victor Petukhov d32d0a65f0 Revert "Report warning on @JvmStatic in private companion objects"
This reverts commit 9669ab14
2020-12-16 10:24:18 +03:00
Victor Petukhov 94deddef7f Revert "Minor: cover negative cases with test +m"
This reverts commit 04a4f9cd
2020-12-16 10:24:12 +03:00
Andrei Klunnyi 3af0257b38 KTIJ-664 [SealedClassInheritorsProvider]: IDE-specific implementation 2020-12-15 18:43:00 +01:00
Denis.Zharkov 5aaaa3881d Refine diagnostic text for NULLABLE_TYPE_PARAMETER_AGAINST_NOT_NULL_TYPE_PARAMETER
^KT-43225 Fixed
2020-12-11 14:22:40 +03:00
Dmitriy Novozhilov 1c9f9130e6 [FE] Prohibit implementing java sealed classes 2020-12-09 22:54:32 +03:00
Denis.Zharkov 92b402759b Report incorrect JVM target only when @JvmRecord is actually used 2020-12-09 16:47:25 +03:00
Denis.Zharkov 3aa55620d0 Prohibit explicit j.l.Record supertype even for @JvmRecord 2020-12-09 16:47:25 +03:00
Denis.Zharkov ddbd62054f Prohibit extending java.lang.Record from non-@JvmRecord classes 2020-12-09 16:47:23 +03:00
Denis.Zharkov 695d0dbfbb Check JvmRecordSupport language feature before generating synthetic properties 2020-12-09 16:47:23 +03:00
Denis.Zharkov b860a0c664 Separate JvmTarget::bytecodeVersion version into major/minor parts 2020-12-09 16:47:22 +03:00
Denis.Zharkov c8851c4f75 Prohibit @JvmRecord for non-data classes
^KT-43677 In Progress
2020-12-09 16:47:22 +03:00
Denis.Zharkov 033f43794d Prohibit irrelevant fields in @JvmRecord classes
^KT-43677 In Progress
2020-12-09 16:47:22 +03:00
Denis.Zharkov f6a3580c93 Add @JvmRecord diagnostics for open and enums
^KT-43677 In Progress
2020-12-09 16:29:04 +03:00
Denis.Zharkov bef50c0342 Correct descriptor shape for @JvmRecord annotated classes
This commit adds relevant functions: hashCode, toString, equals
(if the class is not a data class)
And supertype j.l.Record

It only affects descriptor contents, i.e. works for FE

^KT-43677 In Progress
2020-12-09 16:29:04 +03:00
Denis.Zharkov d4de2c4dce Add check that we have JDK 15 in classpath when using @JvmRecord
^KT-43677 In Progress
2020-12-09 16:29:03 +03:00
Denis.Zharkov 85962d8312 Add check that @JvmRecord classes cannot inherit other classes
^KT-43677 In Progress
2020-12-09 16:29:03 +03:00
Denis.Zharkov 4f5db241ea Add @JvmRecord annotation and relevant diagnostics
^KT-43677 In Progress
2020-12-09 16:29:03 +03:00
Denis.Zharkov 513f7177ca Support loading Java records
^KT-43677 In Progress
2020-12-09 16:29:03 +03:00
Ilmir Usmanov 78e607c6b0 Value classes: Support @JvmName annotation on functions with inline
classes in signatures, but not on methods of inline classes.
2020-11-28 00:34:04 +01:00
Ilmir Usmanov ca3e7cf1a7 Value classes: Report lacking @JvmInline only on JVM backend
Report when @JvmInline is applied on non-value class.
2020-11-27 23:52:07 +01:00
Dmitry Petrov 3a166f3592 KT-43525 forbid @JvmOverloads on mangled funs and hidden constructors 2020-11-24 16:06:20 +03:00