Commit Graph

41936 Commits

Author SHA1 Message Date
Mikhail Glukhikh b5e2fa5f94 Add line marker test for type aliases #KT-20164 Fixed 2017-10-10 10:44:39 +03:00
Mikhail Glukhikh eec8be2c21 Add line marker test for primary constructors #KT-20254 Fixed 2017-10-10 10:44:38 +03:00
Mikhail Glukhikh 0ebe9d576a Add line marker test for sealed classes #KT-20043 Fixed 2017-10-10 10:44:36 +03:00
Mikhail Glukhikh 4e56fda439 Introduce isExpect/ActualDeclaration in KotlinLineMarkerProvider
Treat every member of expect declaration as expect declaration itself
So #KT-18455 Fixed
2017-10-10 10:44:35 +03:00
Mikhail Glukhikh ceab148b09 Expect/actual markers: handle secondary constructors correctly
So #KT-20309 Fixed
2017-10-10 10:44:33 +03:00
Dmitry Petrov 26136cd0fe Check constness of 'apiVersionIsAtLeast' arguments 2017-10-10 09:04:51 +03:00
Dmitry Petrov 23d8b4cefe Do not run CCE if there were no apiVersionIsAtLeast calls 2017-10-10 09:04:51 +03:00
Dmitry Petrov fd16035bbd API version calls preprocessing, 1st passing test 2017-10-10 09:04:51 +03:00
Dmitry Petrov 4e7c4c3976 Minor: inline single use of 'analyzeMethodNodeBeforeInline' 2017-10-10 09:04:51 +03:00
Dmitry Petrov a89f978597 Provide configurable constructor call normalization
Three modes:

- 'disable' (default): normalize constructor calls in coroutines only
  (required because uninitialized objects can't be stored in fields),
  don't insert additional code for forced class initialization;

- 'enable': normalize constructor calls,
  don't insert additional code for forced class initialization;

- 'preserve-class-initialization': normalize constructor calls,
  insert additional code for forced class initialization.
2017-10-10 08:49:19 +03:00
Dmitry Petrov e71090ae4c Spill stack for inline functions only if it's required
Stack should be spilled before inline function call and restored after
call only if one of the following conditions is met:
- inline function is a suspend function
- inline function has try-catch blocks
- inline function has loops (backward jumps)

Note that there're quite some "simple" inline functions in Kotlin stdlib
besides run/let/with/apply. For example, many string operations are
implemented as inline wrappers over Java method calls.
2017-10-10 08:49:19 +03:00
Mikhail Zarechenskiy 1845a87813 Provide no-arg constructors for common expected annotations in stdlib
This is needed because we treat `expect` classes as not having implicit default constructors (see more in KT-15522, f3344ec)
2017-10-09 18:50:38 +03:00
Mikhael Bogdanov bd9ac65eaf Update stdlib jre8 test jvm-target 2017-10-09 16:38:56 +02:00
Mikhael Bogdanov 3c81430bb9 Update cli module jvm-target
#KT-20671 Fixed
2017-10-09 16:38:56 +02:00
Kirill Rakhman 91c35a6c59 Support listOfNotNull in SimplifiableCallChainInspection #KT-20410 Fixed 2017-10-09 16:38:52 +03:00
Dmitry Petrov 82a9c35194 Fix self-reference to singleton in initializer
Singleton instance is "initialized" by delegating constructor call,
which is superclass constructor call in case of singletons (because
singletons can't have more than one constructor).

Singleton constructor is effectively split into two stages:
- before a super constructor call;
- after a super constructor call.

Before super constructor call, singleton instance can't be used directly
(see KT-20662), because neither 'this' nor static instance is
initialized yet. However, it can be used in closures, in which case a
static instance should be used (escaping uninitialized this is
prohibited by JVM). Actually using this static instance before it is
initialized (e.g., invoking a method that uses this singleton) will
cause a correct ExceptionInInitializerError.

After a super constructor call, static instance of a singleton may be
not initialized yet (in case of enum entries and interface companion
objects). However, we already have an initialized 'this', which we
should use for singleton references.

 #KT-20651 Fixed
2017-10-09 16:27:34 +03:00
Vyacheslav Gerasimov 62d0e4a51a Add name for GradleProjectImportProvider
#KT-20648 Fixed
2017-10-09 14:40:35 +03:00
Alexander Udalov 6d9e8c9414 Add Gradle tasks to generate protobuf, update readme 2017-10-09 12:35:46 +02:00
Alexander Udalov 450bfca41f Move dependency generators->protobufFull up in the list
Otherwise protobufLite (required by compiler modules) wins, and
GenerateProtoBufCompare cannot be run
2017-10-09 12:35:42 +02:00
Alexander Udalov 2699868586 Add "-Duser.country=US" to gradle.properties
To make Gradle daemon which is run from IntelliJ IDEA use the same
environment as the daemon run by the "gradlew" command (the latter is
always using US)
2017-10-09 12:34:02 +02:00
Dmitry Petrov a4918748a5 Specialize not-null values using information from current analysis pass
Instead of a separate analysis pass to determine variable types at the
point of null checks, use current data flow information and transform
possibly nullable values to definitely non-null values using a special
intrinsic.

This allows to perform a single data flow analysis pass per RNCE
transformation pass (instead of two passes).
2017-10-09 12:20:40 +03:00
Dmitry Petrov d31efaa7ac Don't analyze method in RNCE if there're no optimizable instructions 2017-10-09 12:20:40 +03:00
Toshiaki Kameyama 0bda2732e5 Fix for KT-19134 IntelliJ Color Scheme editor - allow changing color of colons and double colons (#1314) 2017-10-09 11:02:02 +02:00
Nicolay Mitropolsky d609579e55 FakeFileForLightClass tries to use ktFile.originalFile.virtualFile 2017-10-06 23:53:33 +03:00
Dmitry Jemerov 703d053157 Additional fixes for consistent parent conversion 2017-10-06 20:51:04 +02:00
Dmitry Jemerov bde7a657cf Adapt to new equality rules due to lazy parent calculation 2017-10-06 20:51:04 +02:00
Dmitry Jemerov ada695bd17 Fix loop in parent structure on 'when' condition with expression 2017-10-06 20:51:03 +02:00
Dmitry Jemerov 31fb34d9af Fix and add some required type checks 2017-10-06 20:51:03 +02:00
Vyacheslav Gerasimov b12f24b41c Fix KtLightClass conversion and testParameterPropertyWithAnnotation 2017-10-06 20:51:03 +02:00
Dmitry Jemerov fe021afa37 Temp disable UAST caching 2017-10-06 20:51:03 +02:00
Dmitry Jemerov bab2641bed Don't test parent structure consistency in irrelevant cases 2017-10-06 20:51:03 +02:00
Dmitry Jemerov 61f6db87c4 Use convertOpt() for getting inner classes of script 2017-10-06 20:51:02 +02:00
Dmitry Jemerov a4f5a1335a Fix convering parents of annotations on primary constructor parameters 2017-10-06 20:51:02 +02:00
Dmitry Jemerov 56168b4a09 Fix destructuring declaration test 2017-10-06 20:51:02 +02:00
Dmitry Jemerov a7efc4f5da Return correct parent for parts of converted elvis expression 2017-10-06 20:51:02 +02:00
Dmitry Jemerov e55f4c6e78 Return correct parent element for destructuring declaration initializer 2017-10-06 20:51:02 +02:00
Dmitry Jemerov a44dff6803 Take into account annotation use site target when converting parent 2017-10-06 20:51:01 +02:00
Dmitry Jemerov d976c1d594 Correctly convert KtProperty with no backing field to UAST 2017-10-06 20:51:01 +02:00
Dmitry Jemerov e63838703a Consistently convert local functions to UAST 2017-10-06 20:51:01 +02:00
Dmitry Jemerov 942fe11020 Correctly convert KtParameter to UAST 2017-10-06 20:51:01 +02:00
Dmitry Jemerov adf1df3eb0 Return correct parent for elements under when expression body 2017-10-06 20:51:01 +02:00
Dmitry Jemerov c98c3a7033 Work in progress on consistent UAST structure 2017-10-06 20:51:00 +02:00
Dmitry Jemerov a5a5b37e1e Don't duplicate UAST parent calculation logic 2017-10-06 20:51:00 +02:00
Dmitry Jemerov b638febc41 Fix conversion of destructuring declarations 2017-10-06 20:51:00 +02:00
Dmitry Jemerov 40daeb13d1 Evaluate parents of UAST elements lazily
Also add tests for UAST consistency in various cases
2017-10-06 20:51:00 +02:00
Dmitry Jemerov 91459bbd6a Enable caching of converted UElements for Kotlin 2017-10-06 20:50:59 +02:00
Ilya Chernikov cff6d8cf17 Refactor context classpath discovery, share it to idea's jsr223 host...
...from script-util
fix daemon usage in repls
define compiler classpath for script-util tests explicitly
minor refactorings in the build scripts for better import into idea
2017-10-06 20:12:51 +02:00
xiexed 12e35ccf96 KotlinUastBindingContextProviderService moved to plugin.xml (#1303) 2017-10-06 19:17:25 +02:00
Raluca Sauciuc 768710676b AndroidExtensionsReferenceSearchExecutor should also require a read action (#1327)
... just like AndroidReferenceSearchExecutor does. Otherwise, we get
com.intellij.openapi.application.impl.ApplicationImpl$NoReadAccessException
     [java]    [uitest]         at com.intellij.openapi.application.impl.ApplicationImpl.assertReadAccessAllowed(ApplicationImpl.java:1070)
     [java]    [uitest]         at com.intellij.psi.impl.source.tree.CompositeElement.textToCharArray(CompositeElement.java:291)
     [java]    [uitest]         at com.intellij.psi.impl.source.tree.CompositeElement.getText(CompositeElement.java:261)
     [java]    [uitest]         at com.intellij.psi.impl.source.xml.XmlAttributeValueImpl.getValue(XmlAttributeValueImpl.java:72)
     [java]    [uitest]         at org.jetbrains.android.dom.wrappers.ValueResourceElementWrapper.getValue(ValueResourceElementWrapper.java:458)
     [java]    [uitest]         at org.jetbrains.kotlin.AndroidExtensionsReferenceSearchExecutor.processQuery(AndroidExtensionsReferenceSearchExecutor.kt:42)
     [java]    [uitest]         at org.jetbrains.kotlin.AndroidExtensionsReferenceSearchExecutor.processQuery(AndroidExtensionsReferenceSearchExecutor.kt:38)
     [java]    [uitest]         at com.intellij.openapi.application.QueryExecutorBase.execute(QueryExecutorBase.java:87)
     [java]    [uitest]         at com.intellij.util.ExecutorsQuery.processResults(ExecutorsQuery.java:45)
     [java]    [uitest]         at com.intellij.util.AbstractQuery.forEach(AbstractQuery.java:79)
     [java]    [uitest]         at com.intellij.util.UniqueResultsQuery.process(UniqueResultsQuery.java:66)
     [java]    [uitest]         at com.intellij.util.UniqueResultsQuery.forEach(UniqueResultsQuery.java:56)
     [java]    [uitest]         at com.intellij.psi.search.QuerySearchRequest.runQuery(QuerySearchRequest.java:53)
     [java]    [uitest]         at com.intellij.psi.impl.search.PsiSearchHelperImpl.appendCollectorsFromQueryRequests(PsiSearchHelperImpl.java:635)
     [java]    [uitest]         at com.intellij.psi.impl.search.PsiSearchHelperImpl.processRequests(PsiSearchHelperImpl.java:596)
     [java]    [uitest]         at com.intellij.psi.search.SearchRequestQuery.processResults(SearchRequestQuery.java:45)
     [java]    [uitest]         at com.intellij.util.AbstractQuery.forEach(AbstractQuery.java:79)
     [java]    [uitest]         at com.intellij.util.MergeQuery.processSubQuery(MergeQuery.java:85)
     [java]    [uitest]         at com.intellij.util.MergeQuery.forEach(MergeQuery.java:57)
     [java]    [uitest]         at com.intellij.util.MergeQuery.findFirst(MergeQuery.java:51)
     [java]    [uitest]         at com.intellij.util.UniqueResultsQuery.findFirst(UniqueResultsQuery.java:51)
     [java]    [uitest]         at com.android.tools.idea.editors.theme.ThemeEditorComponent$19.doInBackground(ThemeEditorComponent.java:895)
     [java]    [uitest]         at com.android.tools.idea.editors.theme.ThemeEditorComponent$19.doInBackground(ThemeEditorComponent.java:891)
     [java]    [uitest]         at javax.swing.SwingWorker$1.call(SwingWorker.java:295)
     [java]    [uitest]         at java.util.concurrent.FutureTask.run(FutureTask.java:266)
     [java]    [uitest]         at javax.swing.SwingWorker.run(SwingWorker.java:334)
     [java]    [uitest]         at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
     [java]    [uitest]         at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
     [java]    [uitest]         at java.lang.Thread.run(Thread.java:745)
     [java]    [uitest] [  72230]  ERROR - plication.impl.ApplicationImpl - Android Studio 3.1 Canary  Build #171.SNAPSHOT
2017-10-06 19:11:59 +02:00
Ilya Gorbunov 8b70767d76 Configure pom signing before deployment
Use groovy where kotlin dsl lacks of typed api
2017-10-06 19:50:22 +03:00