Commit Graph

47266 Commits

Author SHA1 Message Date
Mikhael Bogdanov 52b261e19e Fix test data 2018-07-17 13:30:43 +02:00
Alexander Udalov bca3e1b95b Restore getDefaultImports for compatibility with an external plugin
(see ce34deb9af)
2018-07-17 12:48:43 +02:00
Roman Elizarov 2236049341 Wrapper for suspend fun main and @Test suspend fun testXXX functions. 2018-07-17 12:15:02 +03:00
Roman Elizarov d33d21907d SuccessOrFailure test on JVM added 2018-07-17 12:15:01 +03:00
Roman Elizarov 0b59061bfe Coroutines debug probes 2018-07-17 12:15:01 +03:00
Roman Elizarov 78192ea712 Fixed createCoroutineFromSuspendFunction
Passes an object that extends BaseContinuationImpl to the
suspend function invocation, so that it can use .intercepted on it.
This requires implementation to track its state via label variable.
2018-07-17 12:14:59 +03:00
Roman Elizarov d3982472a4 Explanatory comment to createCoroutineFromSuspendFunction 2018-07-17 11:28:48 +03:00
Roman Elizarov 96b5bb1b31 Fixed JVM Serialization problems:
* EmptyCoroutineContext readResolve fixed
* CombinedContext.writeReplace serializes all context elements
2018-07-17 11:28:38 +03:00
Roman Elizarov e0f6165f10 Updated SuccessOrFailure:
* Parameter names for lambda
* getOrElse takes exception parameters
* fold added
* Improved docs
2018-07-17 11:26:49 +03:00
Nikolay Krasko 2a6dfba8bc Check kotlinx.coroutines libraries used with Kotlin 1.3 in Gradle (KT-25251)
#KT-25251 In Progress
2018-07-17 02:46:34 +03:00
Nikolay Krasko f9de91016a Inspection for experimental coroutines imports migration (KT-25251)
#KT-25251 In Progress
2018-07-17 02:22:14 +03:00
Nikolay Krasko 5b34498162 Do not report code style warnings on overridden declarations (KT-25416)
#KT-25416 Fixed
2018-07-17 02:22:14 +03:00
Mikhail Zarechenskiy b6db8971e4 Warn about annotations that targets non-existing accessors
#KT-15453 In Progress
2018-07-17 00:22:53 +03:00
Dmitry Savvinov 70144f8003 Make warning about usage of -XX-flags less scary 2018-07-16 18:49:21 +03:00
Dmitry Savvinov 9634734abf Minor: fix kdoc of LanguageFeature.Kind 2018-07-16 18:49:20 +03:00
Pavel V. Talanov 48a38f1820 Do not try inexact resolve on scripts
Script light psi depends on script definition
    which is costly to compute correctly

 #KT-25395 Fixed
2018-07-16 16:25:18 +02:00
Mikhael Bogdanov 5b8df2f6f2 Use proto flag to determine companion field moved to interface 2018-07-16 16:13:18 +02:00
Mikhael Bogdanov e00b7a993f Write version requirements for @JvmField in interface companion 2018-07-16 16:13:18 +02:00
Mikhael Bogdanov b412c90cef Move version requirements serialization for @JvmDefault to JvmSerializerExtension 2018-07-16 16:13:17 +02:00
Mikhael Bogdanov 0ca3afbb34 Code clean after converion 2018-07-16 16:13:17 +02:00
Mikhael Bogdanov 8633e8b329 Convert JvmSerializerExtension to Kotlin 2018-07-16 16:13:16 +02:00
Mikhael Bogdanov ac7f33a9b5 Rename JvmSerializerExtension.java to JvmSerializerExtension.kt 2018-07-16 16:13:16 +02:00
Mikhael Bogdanov 1d283d243e Support @JvmField on interface properties
#KT-15807 Fixed
2018-07-16 16:13:15 +02:00
Mikhael Bogdanov 719c1882e0 Add new flag to proto for field moved out from interface companion 2018-07-16 16:13:14 +02:00
Mikhael Bogdanov f3b419377b Minor. Reformat 2018-07-16 16:13:14 +02:00
Alexey Sedunov 65e763d562 Misc: Fix flaky test failing due to unstable ordering of libraries 2018-07-16 16:12:23 +03:00
Ilmir Usmanov 8fa3584c5c Minor. Fix test 2018-07-16 15:09:23 +03:00
Ilmir Usmanov bc4a7aec76 Remove suspendCoroutineOrReturn intrinsic from compiler
#KT-21240: Fixed

Also, change logic of intrinsics check.

 #KT-23438: Fixed
2018-07-16 15:09:18 +03:00
Alexander Udalov f766b2c473 Improve "optimize imports" behavior on default imports
Optimize imports to classes when there's an import of a type alias to
that class with the same name. This results in "java.lang.*" imports
being optimized in favor of the corresponding type aliases in "kotlin.*"
which are imported by default
2018-07-16 13:45:11 +02:00
Alexander Udalov ce34deb9af Delete DefaultImportProvider, refactor TargetPlatform.defaultImports 2018-07-16 13:45:11 +02:00
Alexander Udalov 1f0fb4823f Simplify DefaultImportProvider, introduce "low priority imports"
Previously, packages `java.lang` and `kotlin.jvm` were imported on JVM
by default on the same rights, causing problems when the same classifier
existed both in `java.lang` and `kotlin.jvm`. Since the only known case
of such conflict were type aliases to JVM classes, the corresponding
classes (expansions of those type aliases) were manually excluded from
default imports. This made the code in DefaultImportProvider complicated
and resulted in multiple problems, regarding both correctness and
performance (see 82364ad3e5, a9f2f5c7d0, dd3dbda719).

This change adds a new concept, a "low priority import", and treats
`java.lang` as such. Since these imports are now separated from the rest
of default imports in LazyImportScope via secondaryClassImportResolver,
conflicts between classifiers are handled naturally: the one from
`kotlin.jvm` always wins (unless the one from `java.lang` is imported
explicitly, of course). This approach is simpler, safer and does not
require any memory to cache anything.

Skip ResolveToJava.kt test for javac-based resolve; it now fails because
of a weird issue which I didn't have time to investigate (this is OK
because it's a corner case of an experimental functionality)
2018-07-16 13:45:11 +02:00
Mikhail Zarechenskiy 857cc0f728 Make tests about mod and varargs valid for 1.3 version 2018-07-16 14:01:59 +03:00
Alexander Udalov f03dc62173 Ignore tests on big function types until master is 1.3 2018-07-16 11:11:35 +02:00
Alexander Udalov dcbb8045bd Disallow function types with big arity on JVM if LV < 1.3 or API < 1.3
The implementation is a bit obscure because this worked on JS since
Kotlin 1.0 and we should not break that; however, on JVM, a diagnostic
will be reported with old language/API version

 #KT-25241 Fixed
2018-07-16 10:41:27 +02:00
Alexander Udalov 56f509ba09 Support function types with >= 23 parameters
See https://github.com/Kotlin/KEEP/issues/107

 #KT-13764 Fixed
2018-07-16 10:41:27 +02:00
Max Medvedev 5c8afea68e Completion fallback to DescriptorToSourceUtilsIde.getAnyDeclaration
That's in case if DescriptorToSourceUtils.getSourceFromDescriptor fails

#KT-22373 Fixed
2018-07-14 15:17:03 +03:00
Zalim Bashorov 74df1208ae Make "localClassCaptureExtensionReceiver" test more robust and mute it for JS IR BE 2018-07-13 23:42:41 +03:00
Zalim Bashorov 3f0b31dc23 Speed up JS IR BE tests compiling the common parts (runtime + test common utils) once (on demand) and sharing the result between tests
It's a temporary hack until we implement IR based library format.
It relies on the fact that currently, IR BE generates stable (enough) names.​
2018-07-13 23:42:41 +03:00
Zalim Bashorov 34758110ee JS IR test runner: collect all .kt files from the "irRuntime" dir automatically instead of declaring each one in the list 2018-07-13 23:42:40 +03:00
Nikolay Krasko dfcc41ebb0 Fix source position NPE (EA-118863) 2018-07-13 20:00:05 +03:00
Nikolay Krasko f1c87376b9 Another NPE in PlainTextPasteImportResolver.kt (EA-91517) 2018-07-13 20:00:05 +03:00
Nikolay Krasko 5e35fd1758 Check created javaFileFacadeFqName short name (EA-122324) 2018-07-13 20:00:05 +03:00
Nikolay Krasko 819f6c036b Add '//' char to identifier validity check 2018-07-13 20:00:05 +03:00
Nikolay Krasko ee5d357336 Guard PatternConfigurationProducer usages with JUnit presence check (EA-122472) 2018-07-13 20:00:04 +03:00
Nikolay Krasko 752cdedfe2 Stop reporting "using default platform" messages to log (KT-15300)
#KT-15300 Fixed
2018-07-13 20:00:04 +03:00
Alexander Udalov dec003af71 Minor, improve wording in exception message 2018-07-13 18:45:44 +02:00
Alexander Udalov 66b383349f Fix regression in reflection on looking up equals/hashCode/toString in interface
Caused by 4266e50be8 and 8ccbbf71ec. Previously it worked because we
used hardcoded signatures of equals/hashCode/toString and always looked
them up in java.lang.Object

 #KT-25404 Fixed
2018-07-13 18:45:44 +02:00
Alexander Udalov 1f4dfbf5f3 Fix compilation of Java 9 sources for kotlin-reflect-api
Do not pass the jars for modules such as descriptors, descriptors.jvm,
etc to `--module-path` because javac assumes that these are separate
modules (even though they're listed later as parts of this module in
`--patch-module), and prohibits to have split packages and foreign
service implementations among them
2018-07-13 18:45:09 +02:00
Alexander Udalov 0d03d5abf6 Regenerate tests 2018-07-13 18:40:31 +02:00
Denis Zharkov 89d99e3989 Refine diagnostics for nullability migration warnings
#KT-24911 Fixed
2018-07-13 17:51:21 +03:00