Commit Graph

37892 Commits

Author SHA1 Message Date
Alexander Udalov ccfa42289c Fix compilation of kotlin-script-util
'check' was removed in 579238c3be
2017-03-23 11:46:26 +03:00
Nikolay Krasko 84c473d800 Speed up debugger tests by replacing base output preprocessor
Avoid calling InetAddress.getLocalHost() that can be very slow.
Exact connection or disconnection string isn't relevant for tests
anyway.
2017-03-23 00:31:43 +03:00
Nikolay Krasko 9ad705a60a Remove all allFiles*.out from debugger output 2017-03-23 00:31:42 +03:00
Yan Zhulanow cba523958e Android Extensions: Support Dialog classes (KT-16957) 2017-03-22 22:03:22 +03:00
Yan Zhulanow f1e303e18d Minor: Update kapt tests for Kotlin 1.1 2017-03-22 22:03:21 +03:00
Yan Zhulanow 9d8adc1882 Minor: Execute kapt in IDEA tests 2017-03-22 22:03:20 +03:00
Yan Zhulanow e93bc4c00d Kapt3, minor: Enable parameter name saving in javac ClassReader 2017-03-22 22:03:19 +03:00
Yan Zhulanow 7535778ed4 AllOpen, NoArg: Check for the Gradle plugin in the classpath properly
Path segments in the plugin classpath entries are separated by the system file separator, not by '/'.

This fixes KT-16901
2017-03-22 22:03:19 +03:00
Yan Zhulanow 0379254918 Kapt3: Fix compatibility with IC (KT-16753)
Kapt does not support incremental compilation for stubs so we should delete source stubs before running annotation processing.
2017-03-22 22:03:18 +03:00
Yan Zhulanow 8ac14ab930 Android Extensions: Allow to disable IDE support (KT-12741)
Enable IDE plugin only if it is enabled in the build.gradle file.
2017-03-22 22:03:17 +03:00
Yan Zhulanow 5d4cefcc30 AllOpen: Do not make private members open (KT-16627) 2017-03-22 22:03:00 +03:00
Yan Zhulanow bb0a46ac17 Kapt3: Ignore inner classes with clashing names (KT-16458)
Ignore classes (and references to such classes in declaration signatures) if one of the containing classes has the same simple name. This is forbidden in Java, thus should not be present in kapt source stubs.
2017-03-22 22:02:30 +03:00
Yan Zhulanow 2afc27a462 Initial implementation of kapt for Maven (KT-14478) 2017-03-22 22:02:29 +03:00
Yan Zhulanow 40fa5fb758 Kapt3: Support 'processors' option in Gradle plugin (KT-8558)
Also warn if kapt3 options are used without the "apply plugin: 'kotlin-kapt'" specified.
2017-03-22 22:02:28 +03:00
Yan Zhulanow 47ab47d6d1 Kapt3: Support 'processors' option in the compiler plugin (KT-8558)
Support specifying qualified names of annotation processors in the kapt3 compiler plugin (feature-parity with javac).
2017-03-22 22:02:27 +03:00
Yan Zhulanow d30dbf25b5 Kapt1: Allow to use spaces in the collected identifiers (KT-12769) 2017-03-22 22:02:26 +03:00
Yan Zhulanow 948207be30 AllOpen, NoArg: Use the bundled plugins in Maven projects
Use the bundled compiler plugins for Maven projects (as we do for Gradle projects already) because the plugin provided as a dependency in the POM file may have an incompatible version.
2017-03-22 22:02:25 +03:00
Yan Zhulanow 4a2e409948 Kapt3: Support Kotlin sources generation (KT-14070) 2017-03-22 22:02:24 +03:00
Ilya Gorbunov 3088586ac3 Add runnable samples for trimIndent and trimMargin.
#KT-9786 Fixed
2017-03-22 21:54:46 +03:00
Alexander Udalov 579238c3be Remove deprecated declarations from project code, cleanup usages 2017-03-22 20:25:54 +03:00
Alexander Udalov 6a049c9ab5 Fix Java6BuiltInsWithJDKMembersTest
After update of the project to JDK 8, the default JDK at java.home is
now JDK 8. However, this test relied on the fact that the default is JDK
6. Pass the path to the JDK 6 explicitly
2017-03-22 20:24:28 +03:00
Alexander Udalov e4ae7ca4ce Use type substitution when matching header-impl members
Previously, type substitution, which is critical for matching generic
header/impl members with each other, was only performed when
checkImplementationHasHeaderDeclaration was called for impl class
(areCompatibleClassifiers creates the correct substitutor). This was
done in areCompatibleClassifiers: a substitutor which maps type
parameters of the header class to type parameters of the impl class was
created.

Now we create the same substitutor when
checkImplementationHasHeaderDeclaration is called for an impl member of
an impl class as well, manually.

 #KT-15230 Fixed
2017-03-22 20:19:14 +03:00
Alexander Udalov 4c868be869 Minor, render "header" or "impl" in LazyClassDescriptor.toString
This makes debugging of multi-platform compilation much easier
2017-03-22 20:19:13 +03:00
Alexander Udalov 81774926fa Discriminate header class in resolution from sources in AbstractLazyMemberScope
Similarly to getFirstClassifierDiscriminateHeaders, we select the first
non-header class if possible, otherwise we select just the first class.
This makes sure that a reference will never be resolved to a header
class if the corresponding impl class is present.

Note that overall the issue may not be fixed yet, because there are
other scopes where header classes are not yet discriminated
(LazyImportScope, DeserializedMemberScope). However, at this point I
cannot reproduce this problem with these other scopes

 #KT-15521 Fixed
2017-03-22 20:18:16 +03:00
Alexander Udalov 93e3bdc1ab Improve multi-platform integration test
Compile the platform-specific code two times: once with the common file
first and the platform file second, and once with the platform file
first and the common file second in the compilation arguments. This is
needed because some issues in the compiler are only reproducible in one
of these two scenarios
2017-03-22 20:18:04 +03:00
Alexander Udalov 82c5c586b1 Minor, remove unnecessary test data files 2017-03-22 20:11:02 +03:00
Dmitry Jemerov 3caf7f112a Disable JAnsi in tests
Workaround for https://github.com/fusesource/jansi/issues/66
2017-03-22 16:22:40 +01:00
Mikhail Zarechenskiy 2a93dea0c4 Use concrete candidate to resolve collection literal
This helps to avoid resolution errors when there is local array-like function with the same signature as in built-ins
2017-03-22 17:59:58 +03:00
Mikhail Zarechenskiy 222f101d10 Extract collection literal resolve components to separate Kotlin file 2017-03-22 17:59:58 +03:00
Mikhail Zarechenskiy 8466270bdb Check that arguments of array function call in annotation are constants
#KT-16956 Fixed
2017-03-22 17:59:58 +03:00
Mikhail Zarechenskiy a2ea518b1a Allow to use collection literals only in annotations 2017-03-22 17:59:58 +03:00
Mikhail Zarechenskiy bfe2ddf7c1 Introduce language feature for array literals in annotations 2017-03-22 17:59:58 +03:00
Mikhail Zarechenskiy 0f1acab40d Support collection literals in the JVM backend 2017-03-22 17:59:58 +03:00
Mikhail Zarechenskiy 859bccb9fc Propagate resolution results without ambiguity to constant evaluator
This allows to get rid of useless diagnostics that some value is not a constant
2017-03-22 17:59:58 +03:00
Mikhail Zarechenskiy e49b2811ec Apply constant folding for collection literals to use in annotations
Currently this is achieved with several hacks:
- Postpone computation of argument type info when there is no candidate resolver. We have to do this, because we don't have expected type and therefore we could write wrong information to trace
- Presume that for annotation calls there is only one candidate resolver and then resolve arguments with expected type (see `getArgumentTypeInfo`), otherwise because of quadratic complexity of the algorithm resolve would be slow
2017-03-22 17:59:58 +03:00
Mikhail Zarechenskiy c85f6e7d0e Resolve collection literal expression as special array-like function 2017-03-22 17:59:58 +03:00
Mikhail Zarechenskiy d3fd96ceed Parse collection literals as atomic expressions 2017-03-22 17:59:58 +03:00
Dmitry Jemerov 3c7678092e Don't mark compiler-created PSI elements as generated
This saves some memory on storing the generated flag in the PsiElement
userdata and time required to store the flag.
2017-03-22 13:59:21 +01:00
Alexander Udalov dc3aa26e3f Ignore getMembersOfStandardJavaClasses light analysis test
See #KT-16616
2017-03-22 14:33:57 +03:00
Alexey Sedunov 56d22277b7 Move: Filter out ConflictUsageInfo instances before running the refactoring
#KT-16556 Fixed
2017-03-22 13:36:19 +03:00
Alexey Sedunov 2f136dae1c Move: KT-8955
Fix NPE on moving directory where at least one Kotlin file
contains package directive unmatched by the containing directory

 #KT-8955 Fixed
2017-03-22 13:36:18 +03:00
Alexey Sedunov d1857d68bc Move: Fix element listener retrieval
Get element listener before original declaration is invalidated by the refactoring
2017-03-22 13:36:17 +03:00
Alexey Sedunov 1a8aa6091a Move: Fix incorrect FqName when moving declaration to default package
#KT-15586 Fixed
2017-03-22 13:36:16 +03:00
Alexey Sedunov 1331922963 Move: Fix file rename of move
Avoid temporary file rename if the current name doesn't conflict
with other files in the target directory.
Improve protection against exceptions during the refactoring
which may prevent final rename
2017-03-22 13:36:15 +03:00
Alexey Sedunov 92fbca452d Move: Do not report conflict on usages of inherited protected members
#KT-15190 Fixed
2017-03-22 13:36:14 +03:00
Alexey Sedunov e82b256640 Move: Implement conflict checking for internal members
#KT-13190 Fixed
2017-03-22 13:36:13 +03:00
Alexey Sedunov 6f5249ecc7 Move: Fix processing of references to non-real members of companion object
#KT-15559 Fixed
2017-03-22 13:36:12 +03:00
Alexey Sedunov bab762b761 Implement post-refactoring optimization of unused imports
#KT-15822 Fixed
 #KT-13755 Fixed
2017-03-22 13:36:11 +03:00
Alexey Sedunov 7d185349c8 Move: Fix broken tests
Check that constructor call corresponds to class being moved before
transforming outer instance to argument
2017-03-22 13:36:10 +03:00
Alexey Sedunov 13de9aea81 Move: Fix processing of conflicting usages
Exclude conflict-associated usages from refactoring.
Move search of file internal usages to MoveKotlinDeclarationsProcessor
2017-03-22 13:36:09 +03:00