Commit Graph

48237 Commits

Author SHA1 Message Date
Cuihtlauac ALVARADO bf08755969 Factor duplicated code.
Move SimpleScopeTowerProcessor from TowerResolver into ScopeTowerProcessors.

Lift code duplicated in functions:

  * ExplicitReceiverScopeTowerProcessor.simpleProcess()
  * QualifierScopeTowerProcessor.simpleProcess()
  * NoExplicitReceiverScopeTowerProcessor.simpleProcess()

into AbstractSimpleScopeTowerProcessor. Turn it into a function and call it
in the various context. Incidentally, now useless functions resolveAsMember()
and resolveAsExtension() are  removed.
2018-08-24 18:48:03 +03:00
Alexey Sedunov 7ae740dd91 MPP: Add tests for new MPP model import 2018-08-24 18:00:57 +03:00
Mikhail Glukhikh ded652382b "Deferred result not used": report all Deferred results by default
#KT-26181 Fixed
2018-08-24 18:00:56 +03:00
Mikhail Glukhikh 564ea629d1 Add annotations to primary constructor together with 'constructor'
This fixes incorrect behaviour if primary constructor has no explicit
'constructor' keywork
#KT-25548 Fixed
2018-08-24 18:00:54 +03:00
Mikhail Glukhikh c12f29ae30 Enhance inspection about SuccessOrFailure (related to KT-25621)
Increase performance by searching first SuccessOrFailure/runCatching/etc
in text of functions without return type.
Remove stdlib false positives, like success() & failure().
For catching extension, check also non-catching members.
Add "rename to *Catching" fix.
2018-08-24 18:00:46 +03:00
Mikhail Glukhikh 7a2d0a3bb2 Add inspection "Redundant runCatching {}" (related to KT-25621) 2018-08-24 18:00:44 +03:00
Mikhail Glukhikh 2084e94099 Add quick-fix "add .getOrThrow()" for SuccessOrFailure inspection
#KT-25621 Fixed
2018-08-24 18:00:42 +03:00
Mikhail Glukhikh 87d750aa1c Add inspection to detect functions with SuccessOrFailure return type
Partial implementation of KT-25621 (no quick-fixes yet)
2018-08-24 18:00:41 +03:00
Ivan Gavrilovic 48784fd95e Use new API for getting the raw Android resources
A new method has been added in the Android Gradle
plugin 3.3.0. This commit switches from ussing the
MergeResources task, and uses getAllRawAndroidResources
API instead.

Test: manually verified
2018-08-24 17:28:40 +03:00
Roman Artemev 5dcb02466a Update test data 2018-08-24 15:49:13 +03:00
Roman Artemev 2e5940e46d [JS IR BE] Fix object instance reference
* set it in primary constructor prior to constructor body
2018-08-24 15:49:13 +03:00
Roman Artemev 85a8af13cf [JS IR BE] Fix constructor parent 2018-08-24 15:49:13 +03:00
Georgy Bronnikov 30a2058f74 Fix JVM_IR backend crashes when compiling for Android
^KT-23963 Fixed
^KT-23968 FIxed
^KT-23972 Fixed
2018-08-24 15:46:44 +03:00
Roman Artemev cc14442be1 Add tests for primitive companion object
Update test data
2018-08-24 14:58:42 +03:00
Roman Artemev 450ed63690 [JS IR BE] Implement primitive companion object 2018-08-24 14:58:42 +03:00
Dmitry Petrov 2a524920a5 Don't remap inline function args requiring inline class boxing/unboxing
Same as for primitives: inline lambda expects to see a boxed value,
so, even if an argument is a local variable, it can't be remapped,
because it contains unboxed representation.
2018-08-24 14:52:29 +03:00
Dmitry Petrov 6e2d05cd94 Fix argument original type order in InlineCodegen
Arguments are put on stack in the direct order, and then stored into
local variables for inlining in the reversed order:

    <arg0>
    <arg1>
    <arg2>
    store <param2>
    store <param1>
    store <param0>

Original value parameter types were taken in direct order, though.
2018-08-24 14:52:29 +03:00
Mikhael Bogdanov 25b32b8e1d Migrate AbstractLineNumberTest to CodegenTestCase stuff 2018-08-24 13:39:22 +02:00
Alexander Udalov 9c68f2be36 Advance metadata versions and JVM bytecode version
JVM versions are increased in order to differentiate pre-1.3-M2 .class
files where signatures mentioning inline classes were not mangled. Other
versions are increased in case something similar will need to be
detected
2018-08-24 13:01:53 +02:00
Georgy Bronnikov 50e8f7efc7 Track fake overrides for IrField 2018-08-24 13:41:52 +03:00
Yan Zhulanow 01d5e227f0 Pill: Fix resource roots importing 2018-08-24 15:29:55 +05:00
Yan Zhulanow b7873edf30 Pill: Fix issue with clashing sdk-common.jar and sdk-common-26.1.2.jar
Move sdk-common.jar to the end of the classpath
2018-08-24 15:29:55 +05:00
Yan Zhulanow 267e239e52 Pill: Refactoring, introduce a generic predicate in DependencyMapper 2018-08-24 15:29:55 +05:00
Denis Zharkov 83a431fca3 Introduce redundant enum CoroutineSingletons in experimental.intrinsics 2018-08-24 10:55:12 +03:00
Yan Zhulanow bda14fcbb2 Unresolved reference not reported on data class constructor @get annotation (KT-19628) 2018-08-24 04:28:16 +05:00
Yan Zhulanow 463f8dae6a Pill: Add '-ea' option to the default JUnit configuration if missing 2018-08-24 04:28:15 +05:00
Yan Zhulanow b145c97b37 Kapt: Restore line mappings correctly for nested classes and its members 2018-08-24 04:28:13 +05:00
Yan Zhulanow 2328cecffe Minor: Add kotlinx-metadata and kotlinx-metadata-jvm to Pill 2018-08-24 04:28:12 +05:00
Yan Zhulanow c83581e6b8 Kapt: Strict mode. Issue an error if the converter fails to process a class (#KT-25518, #KT-24272) 2018-08-24 04:28:11 +05:00
Yan Zhulanow ef210d7122 Kapt: Do not write references to anonymous classes to stubs & metadata (#KT-25374) 2018-08-24 04:28:09 +05:00
Yan Zhulanow 43f5971863 Remove unneeded 'idea-full' dependency from compiler plugin test runtime classpath 2018-08-24 04:28:08 +05:00
Yan Zhulanow 834ece7d63 Debugger: Remove type checking in file ranking calculator
Type checking makes checking slower and less stable.
2018-08-24 04:28:07 +05:00
Yan Zhulanow d0fd74982d Parcelize, Minor: Fix tests (writeToParcel/describeContents are not final anymore) 2018-08-24 04:28:06 +05:00
Yan Zhulanow d08a32c7cb Kapt: Ignore annotation-processing-gradle compiler plugin we got from Gradle (KT-24714)
Cause it's built for the shaded Kotlin compiler and won't work with JPS.
2018-08-24 04:28:05 +05:00
Yan Zhulanow 8c05769745 Parcelize: Fix infinite recursive loop for zero-parameter Parcelable classes (KT-25839) 2018-08-24 04:26:36 +05:00
Alexander Udalov 475a80b641 Do not write pre-release binaries for stable LV
This commit reverts f6571effcc and
reimplements the desired logic in another way.

In particular, we'd like these two conditions to hold:
1) only the release compiler with stable language settings (meaning,
   language version is a released version of Kotlin and no experimental
   features are enabled) should report errors when _reading_ pre-release
   binaries.
2) the compiler should _write_ pre-release binaries only if language
   settings are not stable, independent of whether the compiler itself
   is release or not.

From these conditions it follows that we must use different logic to
determine how to behave when reading/writing pre-release binaries.
Namely, reading (in CompilerDeserializationConfiguration) now checks if
both the compiler is release and the language settings are stable, and
writing (in LanguageVersionSettings.isPreRelease) checks only that the
language settings are stable
2018-08-23 23:11:30 +02:00
Vyacheslav Gerasimov 053a4b714c Refactor :kotlin-compiler project to allow project(":kotlin-compiler") dependencies 2018-08-23 21:55:26 +03:00
Mikhail Glukhikh 023b1b1880 Shorten quick-fix text of "Redundant async" #KT-25712 Fixed 2018-08-23 18:35:01 +03:00
Mikhail Glukhikh 3dc2c07b23 Simplify description of "Deferred result not used" #KT-25711 Fixed 2018-08-23 18:35:00 +03:00
Mikhail Glukhikh b41ef6a807 Do not report "unused symbol" on experimental annotations
#KT-25609 Fixed
2018-08-23 18:34:59 +03:00
Mikhail Glukhikh 4113a6fd6a Extend fixes of experimental errors to property & type alias
#KT-25525 Fixed
#KT-25526 Fixed
2018-08-23 18:34:57 +03:00
Alexander Udalov f6571effcc Do not report pre-release errors if release LV is used in pre-release compiler
This commit effectively reverts
d386712903.

The reason is that when using a release language version, you can only
"see" the subset of a pre-release library which consists of released and
supported features, so reporting an error is not helpful there. Also, it
presents a problem currently when using kotlinc 1.3 (which is
pre-release) with language version 1.2 (stable) against the bundled
stdlib of version 1.3 (pre-release)

 #KT-21267 Declined
2018-08-23 16:50:48 +02:00
Anton Bannykh 4e496cf2b2 JS: don't throw AssertionError from RedundantCallElimination
Also mark JS `call` function to avoid removing a custom `call`
2018-08-23 14:44:40 +03:00
Roman Artemev 0895f72570 Fix testdata 2018-08-23 14:10:11 +03:00
Dmitry Petrov 34548a0667 Fix primitive override with inline class in Kotlin-Java inheritance 2018-08-23 13:07:07 +03:00
Ilya Chernikov 01eca8bac8 Clean up properties collection 2018-08-23 09:51:53 +03:00
Ilya Chernikov c2e6c0ed49 Rename ScriptingEnvironment to ScriptingHostConfiguration 2018-08-23 09:51:53 +03:00
Ilya Chernikov 2fe5f78921 Rename ScriptEvaluationEnvironment into ScriptEvaluationConfiguration 2018-08-23 09:51:53 +03:00
Ilya Chernikov bb22dadc1e Rearrange compilation related API 2018-08-23 09:51:53 +03:00
Ilya Chernikov bd8f2a81e9 Rename ScriptDefinition to ScriptCompileConfiguration 2018-08-23 09:51:53 +03:00