Commit Graph

41706 Commits

Author SHA1 Message Date
Alexander Udalov 77765a8064 Do not run proguard by default, unless "kotlin.build.proguard" is "true" 2017-09-27 20:15:31 +03:00
Dmitry Jemerov 16a97a8917 Mark multiplatform projects as experimental in the UI 2017-09-27 17:18:12 +02:00
Alexander Udalov a7443adb65 Remove obsolete dependency on cli-parser 2017-09-27 15:47:35 +03:00
Alexander Udalov 24b0b75d8e Do not output compiler jar path during configuration of libraries 2017-09-27 15:47:34 +03:00
Alexey Andreev 3b5c2bbcaa Add Gradle task to run JS tests without DCE
This should be helpful when frequently testing changes in JS BE.
2017-09-27 14:22:15 +03:00
Dmitry Petrov c0a83c3c8a KT-19251 Process uninitialized stores in mandatory bytecode pass
See
https://youtrack.jetbrains.com/issue/KT-19251
https://github.com/puniverse/quasar/issues/280
https://bugs.openjdk.java.net/browse/JDK-8046233

Inline function calls (as well as try/catch expressions) in constructor
arguments produce bytecode that spills stack, and stores uninitialized
objects (created by 'NEW C', but not initialized by 'C.<init>') to
local variables. Such bytecode is valid according to the JVM spec, but
confuses Quasar (and other bytecode postprocessing tools),
and fails to verify under some (buggy) versions of JDK 8.

In order to avoid that, we apply 'processUnitializedStores' already
implemented for coroutines. It moves 'NEW' instructions after the
constructor arguments evaluation, producing code like

<initialize class C using Class.forName>
<evaluate constructor arguments>
<store constructor arguments to variables>
NEW C
DUP
<load constructor arguments from variables>
INVOKESPECIAL C.<init>(...)

NB some other expressions, such as break/continue in the constructor
arguments, also can produce "weird" bytecode: object is created by a
'NEW C' instruction, but later (conditionally) POPped from stack and
left uninitialized. This, as we know, also can screw bytecode
postprocessing. However, it looks like we can get away with it ATM.
Otherwise it looks like we'd have to analyze constructor arguments, see
if the evaluation can "jump out", and perform argument linearization in
codegen.
2017-09-27 12:38:52 +03:00
Andrey Mischenko 3d8486e8a6 Allow to use Gradle property to configure JDK path 2017-09-26 18:14:45 +02:00
Yoshinori Isogai 4428ba0bb7 Add "Generate Tests" run configuration (#1318) 2017-09-26 18:02:03 +02:00
Denis Zharkov d6ee774243 Load some of the TYPE_USE annotations in fast class reading mode
Only top-level types on fields, methods' return types and
value parameters are supported to catch-up how class-files are loaded
in IntelliJ (see IDEA-153093)

NB: this commit also affects
ForeignJava8AnnotationsNoAnnotationInClasspathWithFastClassReadingTestGenerated
that were failing before

 #KT-20016 Fixed
2017-09-26 16:40:47 +03:00
Denis Zharkov 08f3dbce67 Fix configuration for FastClassReading foreign-annotations tests
Prior to this change USE_FAST_CLASS_FILES_READING actually
has not worked because the flag is being read in the KotlinCoreEnvironment
constructor 🤦‍♂️
2017-09-26 16:40:47 +03:00
Denis Zharkov fd9025a4fb Add Java8 foreign-annotations tests without jsr305.jar in the classpath
Some of them are expected to fail since neither IntelliJ class reading
nor our fast class reading can read annotations on type arguments
2017-09-26 16:40:47 +03:00
Denis Zharkov 58a0ca61a9 Minor. Fix java test data to make it actually compilable 2017-09-26 16:40:47 +03:00
Denis Zharkov fdc6b37264 Obtain default type qualifiers from value parameters too
#KT-20016 In Progress
2017-09-26 16:40:47 +03:00
Denis Zharkov 71f85812d6 Improve support for TYPE_USE default qualifiers
- Apply default qualifiers to type arguments if they contain TYPE_USE
in applicability list
- Read TYPE_USE placed default qualifier annotations

 #KT-19592 Fixed
 #KT-20016 In Progress
2017-09-26 16:40:47 +03:00
Denis Zharkov 69665e7560 Minor. Convert function to block body, extract val 2017-09-26 16:40:47 +03:00
Denis Zharkov bd809c872a Minor. Move local functions to file and inline parameter 2017-09-26 16:40:47 +03:00
Denis Zharkov 775d6988e8 Preserve flexibility for Java types annotated with @NonNull(UNKNOWN)
Before this chanhe, these annotations are simply ignored, but they should
preserve flexibility in case of enhanced nullability obtained from
enclosing default qualifier

 #KT-20158 Fixed
2017-09-26 16:40:47 +03:00
Denis Zharkov d0e912167e Minor. Simplify handling nullablility for warning 2017-09-26 16:40:47 +03:00
Denis Zharkov 02d3d9785c Move JSR-305 tests to one directory and strip common name prefix 2017-09-26 16:40:47 +03:00
Denis Zharkov 8a66919a5c Support @NonNull(when = NEVER) nullability annotation
#KT-20131 Fixed
2017-09-26 16:40:47 +03:00
Alexey Tsvetkov 1c7b8ec938 Change test data so IC and non IC warnings count match
When IC is on and new Kotlin class is referencing
new Java class, new Kotlin file is compiled twice,
because JPS thinks new Kotlin class is affected by
new Java class (see https://youtrack.jetbrains.com/issue/KT-20318).

This does not happen when IC is off, and KotlinBuilder
requests chunk rebuild (see previous commit).

I decided to remove the reference, because the issue
is now known, and the reference is non critical for the test.
2017-09-26 16:35:24 +03:00
Alexey Tsvetkov 7a5e0e1107 Request CHUNK_REBUILD when IC is off and there are dirty Kotlin files
Otherwise unexpected compile error might happen,
when there are Groovy files, but they are not dirty,
so Groovy builder does not generate source stubs,
and Kotlin builder is filtering out output directory
from classpath (because it may contain outdated Java classes).

Previously the issue was not detected,
because it was not possible to turn off the IC completely (in JPS),
only switch to the legacy IC.

    #KT-20138
2017-09-26 16:35:24 +03:00
Dmitry Jemerov c290212901 Allow to suppress "Kotlin not configured" notification per-module 2017-09-26 14:52:10 +02:00
Dmitry Jemerov 572ec19c55 SuppressNotificationState: J2K 2017-09-26 14:46:40 +02:00
Dmitry Jemerov e02d121438 SuppressNotificationState: rename to .kt 2017-09-26 14:46:40 +02:00
Dmitry Jemerov 09f826b68d Enable UI Designer instrumentation in Gradle build 2017-09-26 14:43:01 +02:00
Mikhail Zarechenskiy 8a545f05de Provide quick fix for migration of single elements in named arguments
See more in KT-20171
2017-09-26 14:49:43 +03:00
Mikhail Zarechenskiy 8ab7c26cae Provide quick fix for named arguments to varargs in annotations
See more in KT-20171
2017-09-26 14:49:43 +03:00
Mikhail Zarechenskiy 66cb8db12a Support LANGUAGE_VERSION directive in quick fix tests 2017-09-26 14:49:43 +03:00
Mikhail Zarechenskiy 69e3dd89f6 Split diagnostic factory for the ease of code evolution and tooling 2017-09-26 14:49:42 +03:00
Alexey Andreev 3b2d634cea JS: optimize variable representation in coroutines
Don't convert local variables to fields of coroutine object
when variable is both used and defined in a single block.
2017-09-26 13:56:20 +03:00
Alexey Andreev b852f73dd2 JS: make string template optimization more conservative
See KT-18548
2017-09-26 13:56:20 +03:00
Alexey Andreev ca014468ee JS: improve name clash checker to handle complicated cases
See KT-18010
2017-09-26 13:56:19 +03:00
Alexey Andreev 95566b1374 JS: fix serialization of fileId in case of incremental compilation 2017-09-26 13:56:19 +03:00
Nikolay Krasko 3bbf054f0a Fix memory leak from SpecifyTypeExplicitlyIntention 2017-09-26 13:48:22 +03:00
Sergey Igushkin 40ec513c68 Fix tests compilation: cuplicate compileOnly dependencies to testCompile 2017-09-26 13:11:02 +03:00
Kirill Rakhman 1db365bb59 Insert explicit property type while converting accessor to block body
So #KT-20417 Fixed
2017-09-26 12:16:14 +03:00
Nikolay Krasko 31f5c105f3 Remove "javax.annotation.Nullable" usage and clean up file 2017-09-25 20:41:54 +03:00
Nikolay Krasko 412fb62bbb Fix de-reference nullable virtual file (EA-107980) 2017-09-25 20:41:54 +03:00
Nikolay Krasko 500d192063 Remove null assert (EA-107777) 2017-09-25 20:41:53 +03:00
Nikolay Krasko 98c50d3bfb Do not try to create ExactJavaBreakpointVariant with null position (EA-107577) 2017-09-25 20:41:53 +03:00
Nikolay Krasko 8b1fbc9828 fixHost might be null (EA-107022) 2017-09-25 20:41:53 +03:00
Nikolay Krasko fc54018313 Don't convert to PropertyDescriptor without check (EA-92870) 2017-09-25 20:41:53 +03:00
Nikolay Krasko d51f54693f Exist if no identifier found (EA-91332) 2017-09-25 20:41:53 +03:00
Nikolay Krasko 2e7be02d51 Add settings for protobuf plugin 2017-09-25 20:41:53 +03:00
Nikolay Krasko ed2c7d3a9f Minor: fix warnings in increment-version.kts 2017-09-25 20:41:53 +03:00
Sergey Igushkin a23532d1ee Replace the compile dependency on the Gradle API with a compileOnly one 2017-09-25 18:42:39 +03:00
Mikhail Glukhikh e8b95b971d Make parentheses necessary for '(x op return y) op z' #KT-16808 Fixed 2017-09-25 18:16:42 +03:00
Mikhail Glukhikh 426a54c3ab Do not count callable reference as recursive property access
So #KT-20104 Fixed
2017-09-25 18:16:42 +03:00
Dmitry Petrov 8f9ea3e08b Fix const range bounds generation 2017-09-25 17:49:33 +03:00