Commit Graph

2931 Commits

Author SHA1 Message Date
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
Steven Schäfer 4e03b1e05f JVM: Allow the JvmSynthetic annotation on file classes (KT-41884) 2020-11-17 22:06:19 +01:00
Mikhail Zarechenskiy bb2e9e2d56 Extract new method from the publicly used interface for compatibility
Note that we can't just use ``@JvmDefault` annotation as the main change
 is in the `core` module which targets Java 6

 #KT-42259 Fixed
2020-10-27 14:14:39 +03:00
Pavel Kirpichenkov 04a4f9cde6 Minor: cover negative cases with test +m
Add case without reported diagnostic on public companion.
Only report diagnostic if @JvmStatic annotation has source in code.

KT-25114
2020-10-16 11:11:59 +03:00
Pavel Kirpichenkov 9669ab1468 Report warning on @JvmStatic in private companion objects
Deprecation cycle to prohibit in 1.5.
^KT-25114 In Progress
2020-10-16 11:11:59 +03:00
Mikhael Bogdanov c8e84f82eb Proper check NON_JVM_DEFAULT_OVERRIDES_JAVA_DEFAULT in new jvm-default modes
#KT-42699 Fixed
2020-10-15 16:26:00 +02:00
Mikhael Bogdanov b6dc99b98e Skip java defaults in EXPLICIT_OVERRIDE_REQUIRED_IN_MIXED_MODE check
#KT-42674 Fixed
2020-10-15 16:26:00 +02:00
Mikhail Zarechenskiy eacc94a89d Do not hide synthetic properties except isEmpty from Java
In order to hide synthetic property isEmpty from JDK 15, there was
 added additional logic in 5cc12b49fc but
 it also lead to the fact that now it's impossible to call synthetic
 property `declaringClass` on `Enum` as it's in the same list as method
 isEmpty(). Note that it's questionable behavior, probably we should
 also hide `declaringClass` as well but for now we turn it back to
 preserve compatibility

 #KT-42467 Fixed
2020-10-15 12:26:17 +03:00
Denis Zharkov c734bac676 Minor. Reformat JavaNullabilityChecker.kt 2020-10-08 14:00:08 +03:00
Denis Zharkov 90a9ca6cb3 Minor. Rename flag in JvmAnalysisFlags: jsr305 -> javaTypeEnhancementState 2020-10-08 14:00:08 +03:00
Denis Zharkov 5cc12b49fc Hide java.lang.CharSequence::isEmpty from Kotlin built-in class
Also, prohibit using it as a synthetic property

^KT-42467 In progress
2020-10-07 17:48:19 +03:00
Mikhael Bogdanov 5048471835 Properly check default kind on inheriting from old DefaultImpls scheme 2020-10-06 18:10:44 +02:00
Mikhael Bogdanov b27955d268 Wrong specialization diagnostic is reported on java default inheritance 2020-10-05 20:09:21 +02:00
Victor Petukhov fcfabb70d5 Report invisible setter error if it's resolved to synthetic property of base class with public getter and protected setter
^KT-11713 Fixed
2020-09-30 14:35:43 +03:00
Denis Zharkov fdd71c0bce Fix incorrect NULLABLE_TYPE_PARAMETER_AGAINST_NOT_NULL_TYPE_PARAMETER
^KT-42257 Fixed
2020-09-30 14:10:53 +03:00
Vladimir Dolzhenko 3c380faeb5 Added deprecated PackageFragmentProvider#getPackageFragments for BWC
Relates to ^KT-33394
^KT-42259 Fixed
2020-09-29 19:14:44 +00:00
Dmitriy Novozhilov 7380abac13 Split AsmUtils to descriptors dependent and independent parts 2020-09-24 16:51:05 +03:00
Igor Yakovlev 4b8f1bb362 [ULC] Add LanguageVersionSettings to CliLightClassGenerationSupport
+ refactoring
2020-09-11 12:49:04 +03:00
Vladimir Dolzhenko 5036673187 Improve package caching in KotlinJavaPsiFacade
^KT-33394 Fixed
2020-09-10 07:38:46 +00:00
Vladimir Ilmov a5d91339b5 (lightClass) multifile classes facade in libraries added
relates to #KT-39196
2020-09-09 15:01:54 +02:00
Vladimir Ilmov 60dfa8cc84 Ignore ProcessCancelledException in VirtualFileKotlinClass 2020-09-07 12:17:06 +02:00
Dmitriy Novozhilov 6906e0d82d Move common jvm classes from :core:descriptors.jvm to :core:compiler.common.jvm 2020-09-04 11:42:51 +03:00
Dmitriy Novozhilov b81c0e91d5 Replace DescriptorVisibility with Visibility in Java model classes 2020-09-04 11:42:51 +03:00
Dmitriy Novozhilov 696f089b3e Make DescriptorVisibility delegate to Visibility 2020-09-04 11:42:50 +03:00
Dmitriy Novozhilov d1fd1da56f Rename Visibility to DescriptorVisibility 2020-09-04 11:07:42 +03:00
Dmitriy Novozhilov 64ec3fc42b Move BuiltinSpecialProperties and JvmAbi to :core:compiler.common.jvm 2020-09-04 11:07:41 +03:00
Dmitriy Novozhilov 10fd164b77 Extract FE 1.0 dependent part from JavaToKotlinClassMap
Also move JavaToKotlinClassMap to :core:compiler.common.jvm
2020-09-04 11:07:41 +03:00
Dmitriy Novozhilov 0e04af463d Move JvmTypeSpecificityComparator to :compiler:resolution.common.jvm 2020-09-04 11:07:40 +03:00
Dmitriy Novozhilov 564d382b9d Introduce new modules for common jvm related parts of compiler 2020-09-04 11:07:40 +03:00
Florian Kistner 9775a2148a 203: Fix compilation 2020-09-02 18:48:57 +02:00
Dmitriy Novozhilov a764732020 Rename KotlinBuiltInsNames to StandardNames 2020-08-25 10:41:33 +03:00
Dmitriy Novozhilov 7a7fe77b8e Move static constants with builtin names to :core:descriptors.common module 2020-08-25 10:31:36 +03:00
Alexander Udalov 0ef4b22cf3 Remove deprecated usages of ContainerUtil 2020-08-20 20:30:34 +02:00
Alexander Udalov a21f273570 Fix compiler warnings in compiler code 2020-08-17 21:18:20 +02:00
Mikhail Bogdanov 125c72cb8d New default checks for mixed hierarchies
Old and new schemes
2020-07-24 12:10:04 +02:00
Denis Zharkov 037ff2fa52 Fix incorrect handling of @NotNull type parameters
^KT-36770 In progress
^KT-40114 Relates
^KT-28785 Relates
2020-07-22 10:16:14 +03:00
Denis Zharkov 240311d9c7 Minor. Reformat JavaNullabilityChecker 2020-07-22 10:16:14 +03:00
Alexander Udalov 6907decd99 Report file name on exception from ASM in BinaryJavaClass
This is useful to diagnose cases like KT-40339
2020-07-20 22:25:55 +02:00