Commit Graph

39139 Commits

Author SHA1 Message Date
Nikolay Krasko e5822c76fb Allow injection in strings with interpolation (KT-6610)
#KT-6610 Fixed
2017-05-18 20:00:18 +03:00
Nikolay Krasko 12002aed57 Do injection with comments through our injector (KT-6610)
Hide Kotlin from CommentLanguageInjector as it only can insert simple
injection. Process injection by commented strings on our own.

 #KT-6610 In Progress
2017-05-18 20:00:18 +03:00
Nikolay Krasko 0191c8c6c1 Force kotlin injector before temporary injector (KT-6610)
Place KotlinLanguageInject before TemporaryPlacesInjector

TemporaryPlacesInjector injects languages as a single place while we
need to distinguish interpolated and non-interpolated strings. Bad
ordering leads to inconsistent behaviour in temporary injection and
injection with annotations and comments.

See InjectedLanguageManagerImpl.getInjectorMap()

 #KT-6610 In Progress
2017-05-18 20:00:18 +03:00
Nikolay Krasko 2f1a40a40d Use multi host injector for Kotlin injection (KT-6610)
#KT-6610 In Progress
2017-05-18 20:00:18 +03:00
Nikolay Krasko 0551659281 Don't indent to unrelated closing quote (KT-17894)
#KT-17894 Fixed
2017-05-18 20:00:18 +03:00
Nikolay Krasko e211980df4 Minor: Remove commented tests 2017-05-18 20:00:17 +03:00
Nikolay Krasko 0cd3e4f3a4 Minor: JetFile -> KtFile 2017-05-18 20:00:17 +03:00
Alexander Udalov d1c9d0328a Report error if <withKotlin> is run in fork mode
Otherwise the error message is confusing, see #KT-9292
2017-05-18 19:25:21 +03:00
Alexander Udalov 671aed252d Support single Java source files in kotlinc arguments
E.g. "kotlinc foo.kt test/Bar.java" will compile foo.kt, and
declarations from Bar.java will be accessible to Kotlin code in foo.kt.

The change in AbstractTopLevelMembersInvocationTest is needed because an
incorrect configuration was created in that test where a library jar was
also a Java source root (the compiler is never configured this way in
production), which led to an exception in
JavaCoreProjectEnvironment#addSourcesToClasspath

 #KT-17697 Fixed
2017-05-18 19:22:17 +03:00
Mikhael Bogdanov 511c9f86b1 Add new test on receiver clash during default lambda inlining 2017-05-18 18:18:15 +02:00
Mikhael Bogdanov ec23df1d29 Extract callable reference tests to separate directory 2017-05-18 18:18:15 +02:00
Mikhael Bogdanov f4a388cf71 Add new tests for default lambda inlining 2017-05-18 18:18:14 +02:00
Mikhael Bogdanov 42074f143d Report diagnostic on inline parameter usage inside defaul value for another inline parameter 2017-05-18 18:18:13 +02:00
Mikhael Bogdanov 0d1ede40c1 Convert InlineChecker to Kotlin 2017-05-18 18:18:12 +02:00
Mikhael Bogdanov 4a28287c68 Rename InlineChecker.java to InlineChecker.kt 2017-05-18 18:18:11 +02:00
Sergey Igushkin 6a31f8c139 Update ReadMe.md 2017-05-18 17:53:23 +03:00
Alexey Sedunov 23c0e6fcb5 Kotlin Facet: Filter out API versions exceeding library version
Also drop version validator as it's not needed anymore
 #KT-17847 Fixed
2017-05-18 14:22:43 +03:00
Alexey Sedunov d288c684c8 Kotlin Facet: Configure facet if kotlin-android plugin is present
#KT-17861 Fixed
2017-05-18 14:22:42 +03:00
Alexey Sedunov 8f6f69db65 Kotlin Facet: Suppress bogus warning about language/api version
#KT-17848 Fixed
2017-05-18 14:22:41 +03:00
Alexey Sedunov 0994474e87 Presentation: Fix NPE on functional type rendering
#KT-17638 Fixed
2017-05-18 14:22:40 +03:00
Alexey Sedunov a80fb6f20f Copy: Report module accessibility conflicts 2017-05-18 14:22:39 +03:00
Alexander Udalov bfb3b38ebc Do not try to load Java classes from incorrect packages
#KT-11474 Fixed
2017-05-18 13:30:06 +03:00
Alexander Udalov 52237ce77f Fix KClass.java intrinsic for stack values of type Unit
#KT-17692 Fixed
2017-05-18 13:29:04 +03:00
Alexander Udalov 9b85fed3c4 Fix typo in kotlinc-js help
File separator is '/', path separator is ':' or ';'
2017-05-18 13:29:03 +03:00
Alexander Udalov 18a211cb84 Add regression test for obsolete issue
#KT-17365
2017-05-18 13:29:02 +03:00
Denis Zharkov 49453ca705 Avoid dependency on coroutine-related public API changes
These changes has been introduced in c3a032ea0b
to support new scheme for named functions

At the same time they can be avoided by generating some additional
code/accessors in the anonymous classes for coroutine state

Now we cannot simply remove introduced API because of bootstrap problems

 #KT-17898 Fixed
2017-05-18 12:42:12 +03:00
Denis Zharkov 06b598e595 Minor. Rename CoroutineCodegenForLambda.kt -> CoroutineCodegen.kt 2017-05-18 12:42:12 +03:00
Dmitry Petrov c1ef0bfcdb Report deprecation on usage of type alias expanded to a deprecated class
#KT-15243 Fixed
2017-05-18 10:56:02 +03:00
Dmitry Petrov a2db4dc0d5 Fix incremental compilation problems related to type alias constructors
1. Determine source element for descriptors with NO_SOURCE recursively.

2. Always provide type abbreviation for type alias constructor
return type.

 #KT-15495 Fixed
2017-05-18 10:55:16 +03:00
Ilya Gorbunov 2500a182e5 Refactor: use sam-like constructor for comparators 2017-05-17 19:34:44 +03:00
Ilya Gorbunov ddf6599b38 Do not use spread-operator when it causes excessive array copying 2017-05-17 19:34:44 +03:00
baratynskiy 1eb1735ac9 Return from compile() function immediately if javaFiles collection is empty 2017-05-17 17:49:53 +03:00
baratynskiy eb85e9f5f3 Introduce isFromSourceCodeInScope function
See `VirtualFileBoundJavaClass` interface
2017-05-17 17:49:33 +03:00
baratynskiy 91412b0ee9 Add tools.jar for JPS plugin 2017-05-17 17:48:59 +03:00
baratynskiy 71ba8e3ad0 Add tools.jar for command line compiler if -Xuse-javac is specified 2017-05-17 17:48:53 +03:00
baratynskiy 09e4ea55c7 kotlin-maven-plugin: add tools.jar dependency if -Xuse-javac is specified 2017-05-17 17:48:47 +03:00
baratynskiy 5eea3b6569 Introduce experimental -Xuse-javac compilation mode
In this mode, javac AST and Symbol files are used during
Kotlin compilation instead of PSI / binary stuff.
Later, they are reused for Java file compilation.
javac in this mode is integrated into kotlinc.
2017-05-17 17:48:17 +03:00
baratynskiy c9a04fe1e2 Extract VirtualFileBoundJavaClass interface 2017-05-17 17:42:13 +03:00
baratynskiy a815125281 Use JDK 8 in AbstractCompileAgainstKotlin test 2017-05-17 17:42:12 +03:00
baratynskiy 65aac7ae13 Extract AbstractJavaResolverCache 2017-05-17 17:42:10 +03:00
baratynskiy f576f0b4a0 Extract AbstractJavaClassFinder 2017-05-17 17:42:09 +03:00
baratynskiy fe9a2b30fd JavaClassFinderImpl: J2K 2017-05-17 17:42:08 +03:00
baratynskiy 7af5dc7d03 JavaClassFinderImpl: java -> kt 2017-05-17 17:42:07 +03:00
baratynskiy 5c01b6fa20 AbstractCompileJavaAgainstKotlinTest: J2K 2017-05-17 17:42:05 +03:00
baratynskiy be41364fdd AbstractCompileJavaAgainstKotlinTest: java -> kt 2017-05-17 17:42:04 +03:00
Denis Zharkov 63c5d85cf4 Optimize memory footprint for generated protobuf code
The problem was that an overload of CodedOutputStream.newInstance
without size uses 4000 as a default value, thus allocating
a 4k-sized byte array.
At the same time the array remained effectively unused
in the most cases since it only used for storing data
for unknown fields.

Because such arrays are being created for each read of
protobuf message, during compilation of IntelliJ project
it was producing 25% of redundant memory traffic.

Of course these arrays were all in the young gen, but still
they have some effect on GC
2017-05-17 14:34:11 +03:00
Denis Zharkov 692840860e Use allScope when resolving classifiers of binary classes
Otherwise it might lead to the problems when reading class files
from the source scope (e.g. a groovy file or an already compiled java file)

Note that it may be reproduced only with Maven because in JPS
and Gradle we reading source java files even when they're shouldn't be
recompiled, while in Maven we read class files in the case

 #KT-17897 Fixed
2017-05-17 14:33:23 +03:00
Mikhael Bogdanov d9dc2bd443 Minor. Fix review remarks 2017-05-17 10:20:04 +02:00
Mikhael Bogdanov fd561c6cb9 Support default bound callable reference inlining
#KT-6884 Fixed
2017-05-17 10:20:03 +02:00
Mikhael Bogdanov 8a083a41d5 Clean code after transformation 2017-05-17 10:20:02 +02:00