Commit Graph

47514 Commits

Author SHA1 Message Date
Alexander Udalov 0c8b231fde Add tests on coercion to Unit for callable references
#KT-11723
2018-08-01 16:26:07 +02:00
Alexander Udalov 9babd90999 Support default arguments and varargs for callable references
#KT-8834
 #KT-19869
 #KT-25514
2018-08-01 16:26:06 +02:00
Ilya Chernikov f71909ee73 Fix classpath calculation for scripts, e.g. in JSR-223 setting
#KT-25814 fixed
2018-08-01 13:09:05 +02:00
Nikolay Krasko a406f1b361 Revert registering ClsCustomNavigationPolicy EP in 182 (KT-24891)
Registration can't be removed because there's still a usage in ClsFileImpl:

Caused by: java.lang.IllegalArgumentException: Missing extension point: com.intellij.psi.clsCustomNavigationPolicy in area null
    at com.intellij.openapi.extensions.impl.ExtensionsAreaImpl.getExtensionPoint(ExtensionsAreaImpl.java:335)
    at com.intellij.openapi.extensions.impl.ExtensionsAreaImpl.getExtensionPoint(ExtensionsAreaImpl.java:26)
    at com.intellij.openapi.extensions.Extensions.getExtensions(Extensions.java:104)
    at com.intellij.openapi.extensions.Extensions.getExtensions(Extensions.java:98)
    at com.intellij.openapi.extensions.Extensions.getExtensions(Extensions.java:93)
    at com.intellij.psi.impl.compiled.ClsFileImpl.getNavigationElement(ClsFileImpl.java:312)
2018-08-01 14:02:59 +03:00
Mikhael Bogdanov 2b3162732b Fix lazy parent calculation for property accessor 2018-08-01 12:29:31 +02:00
Mikhael Bogdanov bf60835975 Delete unused properties 2018-08-01 12:29:30 +02:00
Mikhael Bogdanov b27177b7ee Get rid of 'referenceAllTypeExternalClassifiers' 2018-08-01 12:29:30 +02:00
Mikhael Bogdanov b22352a60d Get rid of 'externalPackageFragments' and 'dependencyModules' in IrModuleFragment 2018-08-01 12:29:29 +02:00
Mikhael Bogdanov 0df6fddd0a Extract utils from ReferenceSymbolTable 2018-08-01 12:29:28 +02:00
Mikhael Bogdanov 8a0c585c09 Move lazy var to separate file 2018-08-01 12:29:28 +02:00
Mikhael Bogdanov bee0803ac9 Generate ExternalPackageFragment lazily 2018-08-01 12:29:27 +02:00
Mikhael Bogdanov 1bf3f4bda7 Extract ReferenceSymbolTable, support lazy type parameters 2018-08-01 12:29:27 +02:00
Mikhael Bogdanov 6623799671 Clean 2018-08-01 12:29:26 +02:00
Mikhael Bogdanov 952bc6da63 Set parent for non-lazy declarations 2018-08-01 12:29:25 +02:00
Mikhael Bogdanov c19d45a2fc Initial lazy ir implementation 2018-08-01 12:29:25 +02:00
Mikhael Bogdanov 2884d728fd Mute/unmute jvm_ir tests 2018-08-01 12:29:24 +02:00
Mikhael Bogdanov 74aa8f054e Fix type parameters count in synthetic accessor lowering 2018-08-01 12:27:08 +02:00
Dmitry Petrov 60d93aee87 Drop IrProperty.typeParameters 2018-08-01 12:06:41 +03:00
Roman Artemev c9b7db646c Temporary mute test with issue between coroutines and crossinline 2018-08-01 10:56:08 +03:00
Roman Artemev dac1fac957 Unmute working test 2018-08-01 10:55:21 +03:00
Vyacheslav Gerasimov 2ec7c4fd0d Update platform versions for 181, 182, as32, as33 plugins 2018-07-31 19:27:23 +03:00
Pavel V. Talanov e1a27929ac Do not throw on using kotlin resolve via light classes in dumb mode
Fix an exception when kotlin resolve was invoked when searching
    for tests while indexing (probably many other cases)
Does not actually fix the behaviour, the test will not be found
    resulting in undesired behaviour
Full-blown infrastructure for resolving Kotlin in dumb mode is needed
    to fix the behaviour

 #KT-24979 Fixed
2018-07-31 14:47:21 +02:00
Dmitry Petrov ea710ce607 IrField.isStatic: Update testData for new test 2018-07-31 14:04:04 +03:00
Dmitry Petrov 6dfcf15a39 IR: IrField.isStatic 2018-07-31 13:39:54 +03:00
Zalim Bashorov 8d97512179 [JS IR BE] Improve diagnostics in tests 2018-07-31 11:28:39 +03:00
Zalim Bashorov 2fb286e39c [JS IR BE] Update tests 2018-07-31 11:28:39 +03:00
Zalim Bashorov 0da14e4189 [JS IR BE] Support calls, property accesses and most of operators on expressions with dynamic type 2018-07-31 11:28:38 +03:00
Zalim Bashorov 4a7ecaa908 [JS IR BE] Add basic support for external declarations 2018-07-31 11:28:38 +03:00
Zalim Bashorov 3c0d0d2ab4 [JS IR BE] Move external declarations to a separate IrPackageFragment to not generate code for them 2018-07-31 11:28:38 +03:00
Zalim Bashorov c66bb8c57d [JS IR BE] Remove no longer needed descriptor based utils 2018-07-31 11:28:38 +03:00
Zalim Bashorov 990ad8719d [JS IR BE] Run each lowering on all files instead of running all lowering on each file 2018-07-31 11:28:38 +03:00
Lucas Smaira 49292cd26c Move model interfaces code from Java to Kotlin 2018-07-30 19:08:04 +03:00
Lucas Smaira 52990c9eb1 Set JAVA and ANDROID_HOME when fetching Gradle models
In BaseGradleIT
2018-07-30 19:08:04 +03:00
Lucas Smaira 8cb03fcdec Fix model tests in Windows
By comparing files instead of paths, avoiding problems with separator
'/' or '\'.
2018-07-30 19:08:04 +03:00
Lucas Smaira 5e515590cb Restrict methos in Tasks.kt to internal 2018-07-30 19:08:04 +03:00
Lucas Smaira 3588547d8c Remove *ImplTest for Kotlin Gradle Models
Equality should already be guaranteed by Kotlin data classes.
2018-07-30 19:08:04 +03:00
Lucas Smaira 3c88f761a6 Introduce tooling model for Android extensions plugin
Introduce Gradle models for plugins 'kotlin-android-extensions'.
2018-07-30 19:08:04 +03:00
Lucas Smaira 5a423e8dcd Introduce tooling model for annotation based projects
Introduce Gradle models for plugins 'kotlin-allopen', 'kotlin-noarg' and
'kotlin-sam-with-receiver'. Corresponding model builders are registered
in each one of those plugin main classes.
2018-07-30 19:08:04 +03:00
Lucas Smaira 5671dbb929 Introduce tooling model for Kapt gradle projects
A Kapt model for Gradle projects including 'kotlin-kapt'plugin is
introduced. Its model builder KaptModelBuilder produces an
implementation of these models and can be queried through the Gradle
Tooling API when needed. Model builder is registered in
Kapt3GradleSubplugin.
2018-07-30 19:08:04 +03:00
Lucas Smaira 9def6f020f Introduce tooling model for Kotlin gradle projects
A KotlinProject model for Gradle projects including Kotlin (JVM, JS or
common) plugins is introduced. Its model builder KotlinModelBuilder
produces an implementation of these models and can be queried through
the Gradle Tooling API when needed. Model builder is registered in the
corresponding Kotlin Gradle plugins.

Model definition should be published as a separate artifact in public
repositories so it can be consumed when needed.
2018-07-30 19:08:04 +03:00
Ilmir Usmanov 4b03db771a Minor. Fix test. 2018-07-30 18:59:44 +03:00
Mikhail Zarechenskiy acd5b62148 Introduce limited constant conversions for Kotlin/Native
#KT-25320 Fixed
2018-07-29 04:32:32 +03:00
Alexander Udalov 1a51132884 Add CLI tests on internal from other module (JVM, JS, common) 2018-07-27 18:51:42 +02:00
Alexander Udalov 4bd66d5aa8 Add compiler argument -Xfriend-paths for kotlinc-jvm
#KT-21910 Fixed
2018-07-27 18:51:42 +02:00
Dmitry Savvinov 8edbb10420 Fix typo introduced in f90b29c2e3 2018-07-27 18:55:52 +03:00
Dmitry Savvinov f90b29c2e3 Support contracts in PartialBodyResolveFilter
Previously, PartialBodyResolveFilter didn't know about contracts and was
filtering out calls of such functions, leading to unstable completion in
cases like that:

fun test(x: Any?) {
    require(x is String)
    x.<caret>
}

However, PartialBodyResolveFilter works by pure PSI, while to determine
if function has a contract we have to resolve it.

To solve it, we do something very similar to what has been done with
Nothin-returning functions: introduce
KotlinProbablyContractedFunctionShortNameIndex, which collects all
function which *may* have a contract during indexing.

^KT-25275 Fixed
2018-07-27 16:59:24 +03:00
Dmitry Savvinov 5ab79a111d Introduce 'mayHaveContract'-flag in stubs
This is needed for further commit, which supports contracts-based
smartcasts in partial body resolve mode.

NB: Stubs can be built from 3 sources:
- source code (contract presence can be checked by PSI)
- binary data (contract presence can be checked by Kotlin Metadata)
- decompiled sources

The last case is a bit of a headache, because usually bodies are omitted
in decompiled sources. To workaround it, we have to inject stubbed
contract-call in the body.
2018-07-27 16:59:24 +03:00
Dmitry Savvinov 24245c2245 Support compiler test directives in PartialBodyResolve tests 2018-07-27 16:59:23 +03:00
Dmitry Savvinov ca64346b55 Add compiler test directives to the list of valid directives 2018-07-27 16:59:23 +03:00
Dmitry Savvinov 2a57807c85 Minor: reformat and clean-up KotlinFixtureCompletionBaseTestCase 2018-07-27 16:59:23 +03:00