Commit Graph

80463 Commits

Author SHA1 Message Date
Yan Zhulanow 4e8ec69ca7 Pill: Support kotlinx.serialization plugin 2021-03-16 19:21:49 +09:00
Yan Zhulanow bcce187e3f Pill: Import kotlinx-metadata only in FULL mode 2021-03-16 19:21:49 +09:00
Yan Zhulanow cc41ccc3b9 Pill: Disable all compiler plugins by default 2021-03-16 19:21:48 +09:00
Yan Zhulanow 61cd97b340 Pill: Remove unused EmbeddedComponents class 2021-03-16 19:21:48 +09:00
Yan Zhulanow a00f3b97c5 Pill: Move utility classes to util package 2021-03-16 19:21:48 +09:00
Yan Zhulanow 6da03c0cda Pill: Move project model out of parser file 2021-03-16 19:21:48 +09:00
Yan Zhulanow e4ce48d9ef Pill: Extract artifact-related components to their own package 2021-03-16 19:21:47 +09:00
Yan Zhulanow 901bfbb3c7 Pill: Create KotlinArtifact only for variants that include BASE 2021-03-16 19:21:47 +09:00
Yan Zhulanow 6ff68311c1 Pill: Support module prefixes 2021-03-16 19:21:47 +09:00
Yan Zhulanow a561fb85ad Pill: minor, fix inspection warnings 2021-03-16 19:21:47 +09:00
Yan Zhulanow 4708525b9a Pill: Refactor Pill variants, replace DEFAULT variant with nullable value 2021-03-16 19:21:46 +09:00
Yan Zhulanow 51a23b7aeb Pill: Always import Pill importer module for debugging purposes 2021-03-16 19:21:46 +09:00
Yan Zhulanow c2cbbc5aba Pill: Removed unused NONE variant 2021-03-16 19:21:46 +09:00
Yan Zhulanow a355d82b37 Pill: Fix warnings in PillExtension 2021-03-16 19:21:46 +09:00
Yan Zhulanow f84c1d7354 Pill: Fix warnings in PillExtensionMirror 2021-03-16 19:21:45 +09:00
Yan Zhulanow 880067946e Pill: Do not import kotlin-serialization library as dist dependency as it doesn't exist in dist/kotlinc 2021-03-16 19:21:45 +09:00
Yan Zhulanow 38d88877a3 Pill: Map kotlin-coroutines-experimental-compat library 2021-03-16 19:21:45 +09:00
Yan Zhulanow cc56511585 Pill: Map 'java9' source sets of standard library and tests 2021-03-16 19:21:45 +09:00
Zac Sweers 12a6352bef Fix NPE in KaptJavaLog
See https://issuetracker.google.com/issues/162446295 for more context, but in short: this will fail if the project:
* targets java 8
* consumes external libraries targeting a higher version (java 9+). This includes Android SDK 30's android.jar, which targets java 9
* has `mapDiagnosticLocations` enabled for kapt

targetElement is a nullable type, so this seems like a pretty cut-and-dry NPE fix
2021-03-16 19:21:44 +09:00
Vladimir Dolzhenko 462b752763 Mark flaky test 2021-03-16 11:03:05 +01:00
Dmitriy Novozhilov cef859fced Fix exponential pseudocode size on incorrect prefix increments and decrements
#KT-44153 Fixed
2021-03-16 12:25:23 +03:00
Denis.Zharkov 6c5557dae3 FIR2IR: Optimize computation of fake overrides in lazy classes 2021-03-16 09:28:52 +03:00
Denis.Zharkov fbed88d32d FIR2IR: Do not unwrap fake override when computing overridden 2021-03-16 09:28:52 +03:00
Denis.Zharkov 74ecae7f6d IR: Optimize IrSimpleFunction::collectRealOverrides 2021-03-16 09:28:52 +03:00
Denis.Zharkov 1a36ee2110 IR: Postpone computing real fake overrides at SyntheticAccessorLowering 2021-03-16 09:28:52 +03:00
Denis.Zharkov c09fe3ea6f FIR: Optimize unnecessary interface casts by adding relevant overload 2021-03-16 09:28:52 +03:00
Denis.Zharkov f141c276be IR: Avoid recomputing Symbols::progressionElementTypes 2021-03-16 09:28:52 +03:00
Alexander Udalov d9a9bd0136 Fix compilation of Interop/Runtime after fc36178f3a 2021-03-15 20:34:24 +01:00
Dmitry Petrov d74168fb8f PSI2IR KT-44414 fix adapted reference to imported object member 2021-03-15 21:24:25 +03:00
Mikhail Glukhikh e7129329d2 Revert "FIR: do not eagerly resolve class references in imported annotations"
This reverts commit 1a57d60f
2021-03-15 18:36:13 +03:00
Alexander Udalov 83a4b6396a Deduplicate source roots in psi2ir and CLI
Compiler plugins can add new source roots to the next compilation round
by using `AnalysisResult.RetryWithAdditionalRoots`. Some plugins added
already existing source roots to this list in some cases. For example,
this is reproducible with `square/anvil` with incremental compilation
(KT-45100, KT-44925). Psi2ir didn't deduplicate the source files before,
which resulted in several classes with the same name linked to the same
symbol. This led to a "symbol is already bound" exception, and in case
of KT-44925, to an additional NPE when we were rendering the class to
display it in the message.

The solution is to deduplicate classes before psi2ir. Note that this
commit has two changes, in CLI and in psi2ir. Any one of these is
sufficient for fixing the problem, however both are made just to make it
more future-proof against new components and/or changes in existing
subsystems (e.g. fir2ir).

In the old JVM backend, similar deduplication was happening in
`ClassFileFactory.registerSourceFiles`, which is why the problem is not
reproducible there.

 #KT-45100 Fixed
2021-03-15 16:30:46 +01:00
Alexander Udalov fc36178f3a Annotate kotlin.reflect.jvm.reflect with ExperimentalReflectionOnLambdas
This function was always experimental, as explained in its kdoc, but it
was introduced before opt-in requirement markers were supported. Thus,
breaking changes (such as in KT-42746) were always expected, and the
`@ExperimentalReflectionOnLambdas` annotation just makes it clearer.

 #KT-45486 Fixed
2021-03-15 15:54:31 +01:00
pyos 43140db65e FIR2IR: better filter out non-declared data class properties 2021-03-15 17:32:41 +03:00
pyos 1a57d60f68 FIR: do not eagerly resolve class references in imported annotations 2021-03-15 17:32:39 +03:00
Dmitry Petrov e630e00e99 JVM_IR KT-44744 check accessibility of enum entry 'this' 2021-03-15 17:26:49 +03:00
Svyatoslav Scherbina 14cb762133 Update the docs to reflect Kotlin/Native merge to kotlin repo
Also:
* Revamp kotlin-native/README.md a bit: make it more up-to-date,
  add useful links
* Remove "composite build" section from ReadMe.md:
  it was used for Kotlin + Kotlin/Native composite;
  this is no longer required.
2021-03-15 14:09:00 +00:00
Ilya Kirillov d7da17d8e6 FIR: fix FirOldFrontendDiagnosticsTestGenerated.testVariableInvoke test 2021-03-15 14:31:12 +01:00
Igor Chevdar c37f8ba708 [IR][cache] Fix for https://youtrack.jetbrains.com/issue/KT-44764
The .konanLibrary is cached for each declaration for performance purposes, but it is only ok to do it
after IR has been lowered to its final state (or at least when declarations aren't being moved around),
so the fix respects that by only taking .konanLibrary of a IrFile (it is assumed that files stay on their place
during entire backend lowering procedure).

(cherry picked from commit e021138368b48e306ba99a96f47d93ecbe039f4d)
2021-03-15 15:54:51 +03:00
Alexander Udalov c56f719dcc Fix/suppress some warnings
(cherry picked from commit d8a43c216925b3a9e1475b786978436835a57927)
2021-03-15 15:54:50 +03:00
Igor Chevdar c5249ac714 Disposed target data
(cherry picked from commit 250be87acf66d5c780fb593f46da3540a536e049)
2021-03-15 15:54:49 +03:00
Vladimir Ivanov ba50a8275c Add test for [KT-3706]
Issue is already fixed by metadata-based cinterop

(cherry picked from commit fd4f5b2c07ebdc431d6243ac087f911ee30e88ca)
2021-03-15 15:54:48 +03:00
Vladimir Ivanov 64129314fb Fix sample file naming for case-sensitive FS
(cherry picked from commit 72235c31852fba4f2ab330d8178197c2584b1cda)
2021-03-15 15:54:46 +03:00
Jinseong Jeon 8dce6f2ac9 FIR CFG: don't propagate deadness on the uncaught exception path 2021-03-15 15:54:22 +03:00
Jinseong Jeon d27ecca0e9 FIR CFA: keep UncaughtExceptionPath separated 2021-03-15 15:54:21 +03:00
Mikhail Glukhikh 06a80c0b34 FIR tree generator: merge fields from parents properly 2021-03-15 15:33:38 +03:00
Mikhail Glukhikh 7f7a964b2e FIR: annotate 'replaceSource' with '@FirImplementationDetail' 2021-03-15 15:33:38 +03:00
Mikhail Glukhikh c641fa739b FIR: provide 'replaceSource' only for FirQualifiedAccess inheritors 2021-03-15 15:33:38 +03:00
Dmitriy Novozhilov 4d65b0ef5a [FIR2IR] Unmute passing black box test 2021-03-15 15:12:11 +03:00
Alexander Shabalin f51c85a63f Add test support for types and objects creation
* test_support::TypeInfoHolder to create TypeInfo given payload description
* test_support::Object<Payload> to create objects with Payload and to get them from ObjHeader* after checking that their type_info are layout compatible.
* test_support::*Array<Count> to create various arrays with given length and similarly get them from ArrayHeader*.
2021-03-15 11:25:04 +00:00
Yaroslav Chernyshev aff49c76a9 loadClassOrNull: catch 'ClassNotFoundException' and 'LinkageError' over 'Exception' 2021-03-15 13:35:37 +03:00