Commit Graph

47243 Commits

Author SHA1 Message Date
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
Georgy Bronnikov f85030b1e6 Remove a file added by mistake 2018-07-13 16:16:39 +03:00
Mikhail Zarechenskiy 820d168607 First, check for inline class type before boxing
The problem was that if `type` is of primitive type, but `KotlinType` is
 actually an inline class type, then anyway we boxed this type as primitive
2018-07-13 15:48:21 +03:00
Nicolay Mitropolsky 3c71761cf3 lightAnnotations: check element validity before resolving call 2018-07-13 15:46:44 +03:00
Nicolay Mitropolsky cedc6821c3 lightAnnotations: proper parents for KtLightAnnotationsValues 2018-07-13 15:45:30 +03:00
Georgy Bronnikov 8478c73434 Make @JvmStatic work on JVM_IR 2018-07-13 13:43:02 +03:00
Toshiaki Kameyama 2547612d54 Implement Smart Enter handler for value argument list (KT-18807)
#KT-18807 Fixed
2018-07-13 13:04:19 +03:00
Natalia Selezneva 25cc85241f 172: Fix absent method in 172 branch 2018-07-13 12:02:08 +03:00
Natalia Selezneva 68ffcdc653 182: Fix imports in 182 branch 2018-07-13 11:33:10 +03:00
Natalia Selezneva 6835e5dd6f Wraps syncPublisher() call in KotlinCompilerSettings in a dispose check
Fix ConfigureKotlinTest
2018-07-13 09:50:42 +03:00
Mikhail Zarechenskiy ef2095e4d3 Mute tests about unsigned types for JS backend 2018-07-13 00:27:12 +03:00
Yan Zhulanow a464cc7f28 Minor: Do not report stack traces about PCE to the debug log 2018-07-12 20:36:42 +03:00
Yan Zhulanow 2070d40963 Minor: Move safeSourceName to utils, make it a function 2018-07-12 20:36:41 +03:00
Yan Zhulanow 423bd573a3 Kapt: Do not add imports for overloaded callables (#KT-25071) 2018-07-12 20:36:41 +03:00
Yan Zhulanow 00edc007f8 Minor: Fix the "Could not find installation home path" terminal warning 2018-07-12 20:36:41 +03:00
Yan Zhulanow f6afab1226 Minor: Remove an obsolete warning in Android subplugin 2018-07-12 20:36:41 +03:00
Yan Zhulanow 22cfde3d43 Debugger: Check if the class instance is not yet collected before usage (EA-118758) 2018-07-12 20:36:41 +03:00
Yan Zhulanow a2fdf7d47d Evaluator: Support when expressions (EA-119639) 2018-07-12 20:36:41 +03:00
Yan Zhulanow c749a222eb Debugger: Add a missing read action (EA-119592) 2018-07-12 20:36:41 +03:00
Yan Zhulanow 2203615085 Check if the stackFrame we use is valid (EA-120312)
Unfortunately, the 'isValid' is a private field in StackFrameImpl so we have to catch an exception with an empty catch block.
2018-07-12 20:36:41 +03:00
Yan Zhulanow cf3550b139 Add a number of runReadAction() in debugger (EA-120985) 2018-07-12 20:36:40 +03:00
Yan Zhulanow 115356b990 Eval4J: Do not report certain kinds of exceptions to EA 2018-07-12 20:36:40 +03:00
Yan Zhulanow d8bab58b2c Minor: Fix exception message 2018-07-12 20:36:40 +03:00
Yan Zhulanow d6db9e8f6f Evaluator: Do not report division by zero (EA-122365) 2018-07-12 20:36:40 +03:00