Commit Graph

59312 Commits

Author SHA1 Message Date
Zalim Bashorov fa76b9cf83 [JS IR] Use single line comment instead of JsDoc comment for comments with path 2019-11-21 23:51:08 +03:00
Zalim Bashorov 83e85b3ec8 [JS AST] Add single line comment node 2019-11-21 23:51:08 +03:00
Zalim Bashorov 5fe79f71ad [JS IR] Don't generate comment with path for "empty" files 2019-11-21 23:51:08 +03:00
Zalim Bashorov 4e3a2a0b3e [JS AST] Don't generate a new line after try and if-then blocks 2019-11-21 23:51:08 +03:00
Igor Yakovlev 8f9895e64e Add external keyword support for UL
Fixed #KT-34923
2019-11-21 22:49:23 +03:00
Pavel Kirpichenkov f80a71517f [NI] Handle vararg parameter in reflection type wrt array types
Vararg parameter in reflection type is interpreted as covariant
array type against array in expected functional type and as
vararg element type otherwise. For instance having function
fun foo(vararg args: Int): Unit { /*...*/ }
reference ::foo can be passed against expected
(Int) -> Unit,
(Int, Int) -> Unit, etc.
In none of such cases type for parameter in foo's reflection type
should be changed to array.
However, against expected type (IntArray) -> Unit args' type
must become IntArray.

^KT-25514 Fixed
2019-11-21 20:07:14 +03:00
Igor Yakovlev aba5ff0c1e Fix copy refactoring for multiply kotlin files
Fixed #KT-34971
2019-11-21 19:19:15 +03:00
Mikhail Glukhikh 7d944e2023 FIR dispatch receiver: check nullability only (expected vs actual type)
This gives a minor performance boost and prepares for upcoming K/J type mapping
2019-11-21 19:00:50 +03:00
Dmitry Savvinov 0dc7c37b62 Choose SDK consistently at least for non-COMPOSITE analysis
In COMPOSITE analysis we don't have a constant SDK dependency for whole
ResolutionFacade, so we have to find it manually via calling
'findSdkAcrossDependencies'

In SEPARATE mode we do have such a constant SDK dependency, but there
was an assumption that it doesn't make a difference (i.e.
findSdkAcrossDependencies always return the same SDK as passed constant
one)

Turns out that assumption was wrong, particularly for projects with
duplicate SDK entries in project structure. Then we would choose one SDK
in some cases, and the other one on other cases - even though they a
bit-to-bit equal, we will create separate descriptors for them, which
might lead to some issues, like in KT-34802

^KT-34802 Fixed
2019-11-21 18:56:49 +03:00
Alexander Udalov e4afbae954 Minor, fix test data for kotlinx.serialization bytecode text test 2019-11-21 16:44:30 +01:00
Alexander Podkhalyuzin 4e331d0fb9 Update ReadMe.md
Update usages of old IDEA versions in readme
2019-11-21 18:36:01 +03:00
sergey.igushkin 88dae8025e Fix failure with Kotlin/Native distributions that have no stdlib
Add a warning message during Gradle configuration phase if the
Kotlin/Native distribution is missing the stdlib.

Issue #KT-35033 Fixed
2019-11-21 18:28:59 +03:00
Vladimir Dolzhenko 6a28d1da82 Resolve references in background thread in PlainTextPasteImportResolver
#KT-16774 Fixed
2019-11-21 16:05:08 +01:00
Ilya Goncharov bdb1c2a27f [Gradle, JS] Fix tasks naming
#KT-35019 fixed
2019-11-21 17:48:22 +03:00
pyos d221c1f242 JVM_IR: refactor MoveCompanionObjectFieldsLowering
* Extract replacement of IrGetField/IrSetField into a separate
   file-level lowering (should reduce the amount of work to linear in
   the number of classes rather than potentially quadratic)

 * Extract static backing field construction into JvmDeclarationFactory
   and move that lowering after PropertiesToFields lowering to reduce
   code duplication
2019-11-21 15:14:44 +01:00
Pavel Kirpichenkov afd59f0d46 [NI] Fix 'only input type' check for intersection types
Check worked incorrectly in case when argument type and expected type are the
same intersection type, which is possible for local variables without explicit
type declaration.
2019-11-21 15:59:26 +03:00
pyos 57760e5873 FIR: set anonymous initializers' parents 2019-11-21 15:53:52 +03:00
Alexander Udalov b38153e402 Minor, add runtime and comment to test on multi-file isInitialized 2019-11-21 13:46:53 +01:00
Alexander Udalov bf06d381b9 Minor, move old Java nullability assertion tests under oldLanguageVersions/
Also drop the (now confusing) "_lv12" suffix from newer tests
2019-11-21 13:46:17 +01:00
Vladimir Dolzhenko 16e76fb75a Resolve imports in background thread in PlainTextPasteImportResolver
#KT-34956 Fixed
2019-11-21 13:40:55 +01:00
Svyatoslav Kuzmich bffbe89f53 Advance bootstrap to 1.3.70-dev-1806
Due to updated K/JS klib ABI
2019-11-21 15:33:48 +03:00
pyos 0f4f3f2429 FIR: set correspondingPropertySymbol of backing fields 2019-11-21 15:27:53 +03:00
Mikhail Glukhikh 0dcce9f584 FIR: add forgotten annotation calls resolve at some points 2019-11-21 14:25:27 +03:00
Mikhail Glukhikh 1bc4642fc9 Run CompileKotlinAgainstJava tests in both APT / non-APT modes 2019-11-21 14:25:16 +03:00
Mikhail Glukhikh 393047883e JavacWrapper: add Kotlin classes to classpath only in APT mode 2019-11-21 14:25:13 +03:00
Mikhail Glukhikh 89a582b694 JavacWrapper: perform makeOutputDirectoryClasses hack only in non-APT mode
For some reason, working without APT requires this call in JavacWrapper.
From the other hand, working without APT does not require
Kotlin class files to be in javac classpath.
2019-11-21 14:25:08 +03:00
Ilya Goncharov 64380670c5 [Gradle, JS] Add more info for check exit code 2019-11-21 12:59:52 +03:00
Ilya Goncharov ac241852de [Gradle, JS] Add verbose option to yarn in debug mode 2019-11-21 12:59:52 +03:00
Dmitriy Dolovov 28f2a2a864 Fix: Kotlin/Native libs have non-user friendly representation in IDE
Issue #KT-30288
Issue #KT-34998
Issue #KT-34400 (partially fixes)
2019-11-21 16:56:47 +07:00
Dmitry Petrov d3a5dcb601 KT-35004: keep track of KotlinType for 'when' subject 2019-11-21 10:48:14 +03:00
Mikhail Glukhikh 338b4e2eab Refactor AbstractCompileKotlinAgainstJavaTest 2019-11-21 10:10:58 +03:00
Mikhail Glukhikh 32aba31819 Cleanup: AbstractCompileKotlinAgainstJavaTest 2019-11-21 10:10:53 +03:00
Georgy Bronnikov 307c82e3a4 JVM_IR: redirect to correct function in special brigdes
The fix in MethodSignatureMapper allows us to avoid the hack
with orphanedCopy() in BridgeLowering.
2019-11-20 21:00:59 +03:00
Mikhail Zarechenskiy ef567c868e [NI] Add checkCanceled checks before resolving a candidate
This is an analogue that was done for old inference in CandidateResolver
2019-11-20 18:14:58 +03:00
Mikhail Zarechenskiy 63e62dcf42 Add checkCanceled check on resolving imports path
Imports resolution is a rather time consuming task and doesn't have
 `checkCanceled` on its computation path. So, if a thread is resolving
 imports it will do it until the end of computation, which can lead to
 unnecessary work and some IDE freezes.

 #KT-34990 Fixed
2019-11-20 18:14:57 +03:00
Denis Zharkov db24d4ac9a FIR: Drop ConeTypeAliasLookupTag 2019-11-20 18:02:08 +03:00
Denis Zharkov 38500d27e8 FIR: Add cache for expanded types 2019-11-20 18:02:07 +03:00
Denis Zharkov 159aefd26d FIR: Refactor Cone types
- Get rid of AbbreviatedType
2019-11-20 17:57:35 +03:00
Denis Zharkov e03162f2dd FIR: Rename ConeClassTypeImpl -> ConeClassLikeTypeImpl 2019-11-20 17:55:23 +03:00
Denis Zharkov f178cb6fb3 FIR: Replace trivial usages of ConeClassType with ConeClassLikeType 2019-11-20 17:55:23 +03:00
Alexander Udalov a485a5ffd6 JVM IR: load fields for JvmField properties from dependencies
This is needed to properly lower JvmField property calls to field
accesses.
2019-11-20 15:35:12 +01:00
Alexander Udalov 608449f41d IR: introduce StubGeneratorExtensions for ExternalDependenciesGenerator
This is a refactoring to simplify the API of
ExternalDependenciesGenerator and to constrain future additions of
platform-specific stub generator extensions.
2019-11-20 15:16:57 +01:00
Mikhael Bogdanov c3af2d5a10 JVM_IR. Combine all inline function resolve logic in ResolveInlineCalls lower 2019-11-20 14:37:53 +01:00
pyos 939a9ff53e JVM_IR: fix NPE in interface companion initializers
* When referencing the companion itself, they should use the $$INSTANCE
  field, not the (null until <clinit> returns) Companion field of the
  interface.

* Interface companion init blocks should be made static.
2019-11-20 14:37:19 +01:00
pyos 7c015564ce JVM_IR: do not set ACC_VARARGS if vararg is not the last parameter
Fun fact: this is not actually validated when loading the class; and
even when compiling a java file against a class file that does this,
only javac 9 has a check (1.8 and before simply crashes with
NullPointerException somewhere deep inside the compiler).
2019-11-20 13:40:46 +01:00
Mark Punzalan 7adffe0007 Handle withIndex() on Iterables (including progressions) and Sequences
in ForLoopsLowering.
2019-11-20 13:02:21 +01:00
Mark Punzalan a54d9482dd Handle withIndex() on arrays and CharSequences in ForLoopsLowering. 2019-11-20 13:02:21 +01:00
Mark Punzalan 735535dd5a Extract HeaderInfo base class and add NumericHeaderInfo class, in
preparation for handling withIndex().
2019-11-20 13:02:21 +01:00
Mark Punzalan 2ab539c5eb Encapsulate variable construction and declaration order logic within
ForLoopHeader instead of in HeaderProcessor.
2019-11-20 13:02:21 +01:00
Mark Punzalan 60c05362d2 Refactor ForLoopHeader to clarify the purpose of its functions. 2019-11-20 13:02:21 +01:00