Commit Graph

46965 Commits

Author SHA1 Message Date
Alexey Sedunov 03ed4e39e3 Search Everywhere: Recover original behavior for non-functions
#KT-25189 Fixed
2018-07-02 20:18:21 +03:00
Alexander Udalov e4af8dc7d8 Improve reflection error message when function/property is not found 2018-07-02 18:49:09 +02:00
Alexander Udalov 4f2fdd1c01 Load all resources in RuntimePackagePartProvider; optimize code
The issue was reproducible when the same package is present in different
modules with the same -module-name (which is a popular case of src/test
roots in simple IDEA projects). The problem was in the fact that several
resource files containing package name mapping with the same name were
present in the classpath, but RuntimePackagePartProvider only considered
the first one. The fix is to use getResources instead of
getResourceAsStream and handle each returned resource.

Also, optimize internal representation to store the mapping in the form
which is the most convenient for findPackageParts, which should be
faster than registerModule because in theory, it's called more often.

 #KT-21973 Fixed
 #KT-24651
2018-07-02 18:49:09 +02:00
Alexander Udalov 8ccbbf71ec Remove obsolete BuiltInFunction and mapIntrinsicFunctionSignature
This is now fully covered by the JVM signature mapping, introduced in
the previous commit. The change in KDeclarationContainerImpl.methodOwner
is needed because primitive classes have no methods on JVM; and when
we're looking for "Int.equals", we'll now look it up in the Class object
for java.lang.Integer, not for the primitive int.
2018-07-02 18:49:08 +02:00
Alexander Udalov 4266e50be8 Use manual type mapping in reflection for members from built-ins
There are cases when members deserialized from JVM classes have no JVM
signature in the proto. For example, if a member is inherited from a
built-in class (such as Map.getOrDefault in some Map implementations),
or if a member is synthesized in the compiler front-end and back-end
separately (such as enum values/valueOf). In these cases, we'll use the
naive type mapping to try to recover the signature.

 #KT-16616 Fixed
 #KT-17542 Fixed
2018-07-02 18:49:08 +02:00
Alexander Udalov a7c80f2df1 Reformat module reflection.jvm, fix inspections/warnings 2018-07-02 18:49:08 +02:00
Alexander Udalov 25ee67a644 Catch SecurityException when reading system property in BitEncoding
This does not fix KT-15167 though because the exception from KT-20575 is
thrown shortly afterwards

 #KT-15167
2018-07-02 18:49:08 +02:00
Alexander Udalov 42de05f3fa Improve diagnostic for missing BuiltInsLoader implementation
Also initialize it lazily to avoid wrapping the exception into
ExceptionInInitializerError

 #KT-20575
2018-07-02 18:49:08 +02:00
Alexander Udalov 50c515deca Do not serialize constructors for anonymous objects
The only client of this data is reflection, and since anonymous objects
do not have constructors in the source code, they shouldn't in
reflection as well

 #KT-20442 Fixed
2018-07-02 18:49:08 +02:00
Alexander Udalov 17fc41e0f9 Do not create primary constructor for enum entry synthetic class
The change in DescriptorSerializer is needed so that serialized protos
of enum entry classes which are resolved in sources
(LazyClassDescriptor) and are deserialized from binaries
(EnumEntrySyntheticClassDescriptor) are the same. There are tests on
incremental compilation in JS that check that the serialized proto is
exactly the same after rebuild and after an incremental build.

 #KT-22048 Fixed
2018-07-02 18:49:08 +02:00
Alexey Sedunov b52b07ec79 Test Support: KT-22306
Do not show run markers in JS modules when no relevant run configurations are available

 #KT-22306 Fixed
2018-07-02 19:15:52 +03:00
Alexey Sedunov 3e91346240 Rename: Fix processing of references to synthetic Java properties
Fixes for non-master-bunch plugin.xml
2018-07-02 19:15:51 +03:00
Alexey Sedunov 22d74276a0 Misc: Configure stdlib in failing tests 2018-07-02 19:08:10 +03:00
Alexey Sedunov 65dad5eb74 Misc: Fix test assertion 2018-07-02 19:08:10 +03:00
Mikhail Zarechenskiy 59567c8012 Improve exception message to detect actual problem
This relates to EA-120082, EA-119637
2018-07-02 16:12:39 +03:00
Mikhail Zarechenskiy 2e88f5c47d Prohibit operator mod as declaration and calls that resolved via it
#KT-24197 Fixed
2018-07-02 16:12:36 +03:00
Roman Artemev c887b88ed9 Fix coroutine test generator 2018-07-02 15:35:02 +03:00
Nikolay Krasko f1a44ed1a4 Allow to disable bad format inspection for unchanged files (KT-25199)
#KT-25199 Fixed
2018-07-02 15:06:47 +03:00
Nikolay Krasko 30a2969887 Move KotlinCleanupInspection to Migration group 2018-07-02 15:06:47 +03:00
Denis Zharkov 3b968351bb Load Java overrides of Kotlin suspend functions as suspend, too
There's still some blind spots:
- Covariant overrides in Java (KT-25036)
- Current implementation assumes that when language version is 1.3 every suspend function
reference only release-coroutines-package Continuation
(we need to check if it's a correct statement)

 #KT-24848 Fixed
 #KT-25036 Open
2018-07-02 14:14:59 +03:00
Denis Zharkov 0fc9bb3f4a Minor. Reformat LazyJavaClassMemberScope.kt 2018-07-02 14:14:59 +03:00
Mikhail Zarechenskiy de60c9b635 Fix language features in tests for gradual migration to 1.3 version 2018-07-02 12:13:11 +03:00
Vyacheslav Gerasimov 931ebb4c3c as32: Limit until-build to prevent installation on AS 3.3 2018-07-01 00:09:21 +03:00
Alexey Tsvetkov ece991639e Do not compile jps tests for android studio
I accidentally enabled compilation in one of my previous commits
2018-06-29 20:16:53 +03:00
Ilya Gorbunov bed26dc700 Fix local delegated property smartcast usage 2018-06-29 20:11:03 +03:00
Nicolay Mitropolsky 80f022c3d5 182: IDEA sdk set to 182.3458.5 2018-06-29 16:42:44 +03:00
Dmitry Petrov bbcb12ea4b samAdapter test doesn't actually need FULL_JDK 2018-06-29 14:27:57 +03:00
Dmitry Petrov 92430fc63a Update testData for JS_IR tests 2018-06-29 14:23:09 +03:00
Dmitry Petrov 38e9c86443 Update testData for irCfg and sourceRanges tests 2018-06-29 14:01:54 +03:00
Dmitry Petrov f0050930b5 Add ":compiler:ir.backend.common" to compilerModules 2018-06-29 11:24:46 +03:00
Mikhael Bogdanov da0a966d65 Initialize return type and use unit type in IrDelegationConstructorCall
(cherry picked from commit faac924)
2018-06-29 11:24:46 +03:00
Mikhael Bogdanov 7bd5031eaf Fix array check
(cherry picked from commit e662f82)
2018-06-29 11:24:46 +03:00
Dmitry Petrov b1d0a5e807 Fix delegated function body generation 2018-06-29 11:24:46 +03:00
Dmitry Petrov 71c5bf0b97 Fix annotation copying for IrValueParameters 2018-06-29 11:24:46 +03:00
Dmitry Petrov 799fcc2606 Fix IrType rendering, update testData 2018-06-29 11:24:46 +03:00
Dmitry Petrov 7fd3fac122 Minor: fix after rebase 2018-06-29 11:24:46 +03:00
Mikhael Bogdanov 2a721ea0f6 Fix EnumClassLowering
(cherry picked from commit 1aa7e1a)
2018-06-29 11:24:46 +03:00
Mikhael Bogdanov 95d72d0a32 Fix unbound symbol problem
Make property initialization non-lazy to bind owner by general mechanism

(cherry picked from commit eec6c18)
2018-06-29 11:24:46 +03:00
Mikhael Bogdanov ba9f12b617 Use original descriptor for property stub generation
(cherry picked from commit 1a9f242)
2018-06-29 11:24:46 +03:00
Zalim Bashorov 068859eece Minor: use right type for null literal
(cherry picked from commit 88c824b)
2018-06-29 11:24:46 +03:00
Zalim Bashorov 56bf1f895c Mute failed test for JS IR BE
(cherry picked from commit 6d379a6)
2018-06-29 11:24:46 +03:00
Zalim Bashorov 15f33dd94a Unmute some tests for JS IR BE
(cherry picked from commit 04a9622)
2018-06-29 11:24:46 +03:00
Zalim Bashorov bf2aa5263e JS IR BE: migrate to IR types
(cherry picked from commit 064f47b)
2018-06-29 11:24:46 +03:00
Zalim Bashorov 952163b2fb IR: define references to Throwable, KCallable and KProperty classes inside IrBuiltIns
(cherry picked from commit f92bda0)
2018-06-29 11:24:46 +03:00
Zalim Bashorov 92407c509f IR BE common: add KotlinType based utils
(cherry picked from commit d8be3a6)
2018-06-29 11:24:46 +03:00
Zalim Bashorov 686a3d631c IR BE common: provide type arguments count explicitly for ir calls to reduce dependency on descriptors
(cherry picked from commit af76ae2)
2018-06-29 11:24:46 +03:00
Zalim Bashorov f002e6030a IR BE common: use another ctor of IrGetValueImpl in LocalDeclarationsLowering
(cherry picked from commit 7e34d6e)
2018-06-29 11:24:46 +03:00
Zalim Bashorov d5906dd584 IR BE common: fix InnerClassesLowering
(cherry picked from commit 4239a5f)
2018-06-29 11:24:46 +03:00
Zalim Bashorov 072804af52 ir.tree: uncomment and fix IrFunction.createParameterDeclarations
(cherry picked from commit af8b4be)
2018-06-29 11:24:46 +03:00
Zalim Bashorov 6bc86bd42f IR: add ClassifierDescriptor.toIrType and KotlinType.toIrType
(cherry picked from commit 3e09659)
2018-06-29 11:24:46 +03:00