Commit Graph

37017 Commits

Author SHA1 Message Date
Alexander Udalov f6c3aa0807 Fix JvmBuildMetaInfoTest.testSerialization
Do not check against hard-coded values of parameters, because they might be
changed a lot in the future
2017-01-30 20:22:54 +03:00
Mikhail Glukhikh 8bf233e686 Change log update for 1.1.0 2017-01-30 20:21:13 +03:00
Yan Zhulanow 1b337e1a48 Generate enum values with bodies properly (KT-15803) 2017-01-30 20:13:08 +03:00
Yan Zhulanow 18e0baa13e Kapt: Allow empty .kt files list in kapt in order to support kapt with Java-only source files. (KT-15675) 2017-01-30 20:13:08 +03:00
Ilya Gorbunov 38b79a51d5 Fix tests after introducing exlcusions to default imports of kotlin.js package. 2017-01-30 19:44:51 +03:00
Ilya Gorbunov 33f3106157 Do not use Math in common code. 2017-01-30 19:44:51 +03:00
Ilya Gorbunov 66abea1f19 Add explicit imports of kotlin.js.* to stdlib where required. 2017-01-30 19:44:51 +03:00
Ilya Gorbunov 25c3064554 Add explicit imports of kotlin.js.* to generated files. 2017-01-30 19:44:51 +03:00
Ilya Gorbunov cd5f68f119 Add exclusions to JS platform default imports 2017-01-30 19:44:51 +03:00
Alexey Andreev d0b7dc8f4e JS: don't fail when generating signature for function which refers to undefined type 2017-01-30 19:26:24 +03:00
Ilya Gorbunov f4ef98c327 Remove test for named native 2017-01-30 19:21:41 +03:00
Ilya Gorbunov c4a0bb727d Change LoadBuiltinsTest testData, add runtime and import to box tests.
#KT-16030
2017-01-30 18:55:05 +03:00
Ilya Gorbunov 4ac7be9fa5 Retract bitwise operators from builtins for Byte and Short and add them as extensions in kotlin.experimental package in stdlib.
#KT-16030
2017-01-30 18:54:59 +03:00
Dmitry Jemerov 9b820202b5 Don't run decompiler to check whether reference is in copied fragment
#KT-16038 Fixed
2017-01-30 16:32:46 +01:00
Dmitry Jemerov 8968d5663d Minor fixes for stdlb kdoc 2017-01-30 16:13:49 +01:00
Alexey Sedunov 60edc46d8c Spring Support: Consider declaration open if it's supplemented with a preconfigured annotation in corresponding compiler plugin
#KT-15444 Fixed
2017-01-30 17:54:53 +03:00
Dmitry Jemerov f73d32afeb Look at parent project when checking whether the Kotlin Maven plugin is applied in a module
#KT-15954 Fixed
2017-01-30 15:53:37 +01:00
Alexey Andreev 06e8f7b328 JS: don't report error when FAKE function overrides external function with optional parameters. Report only when it overrides at least two such functions. See KT-15961 2017-01-30 17:26:07 +03:00
Simon Ogorodnik d117b0210f Revert "KT-14252 Completion could suggest constructors available via typealiases"
Reverted due problems with tests
This reverts commit 55eeb74c08.
2017-01-30 16:46:38 +03:00
Anton Bannykh 77aa685496 JS: char boxing 2017-01-30 16:31:44 +03:00
Simon Ogorodnik 55eeb74c08 KT-14252 Completion could suggest constructors available via typealiases
#KT-14252 fixed
2017-01-30 16:24:12 +03:00
Alexander Udalov 167155388d Rename JsBinaryVersion -> JsMetadataVersion
For consistency with JvmMetadataVersion
2017-01-30 16:05:46 +03:00
Alexander Udalov e9a737b85a Promote severity of configuration warnings to STRONG_WARNING
The reason is that these configuration problems may be the reason of
compilation errors, but they were hidden from the output because warnings are
not reported when there's at least one error
2017-01-30 16:01:29 +03:00
Alexander Udalov 7ac96163ac Introduce CompilerMessageSeverity.STRONG_WARNING
This is a severity for mandatory warnings, i.e. those which should be reported
in any case, even if there are compilation errors
2017-01-30 16:01:27 +03:00
Alexander Udalov 268d10d3f0 Advance JvmMetadataVersion to 1.1.4, change IS_PRE_RELEASE to false
Kotlin 1.1 is no longer considered a pre-release
2017-01-30 16:00:05 +03:00
Alexander Udalov 1025fe9307 Minor, remove unnecessary logging for valid erroneous case
It seems that it's normal for VirtualFile in this place to be invalid in this
way
2017-01-30 15:57:51 +03:00
Alexander Udalov 933bcb3511 JS: do not require "id" in the File protobuf message 2017-01-30 15:55:20 +03:00
Denis Zharkov 88b82d5fa2 Exclude coroutine inrinsics and internal packages
#KT-16018
2017-01-30 15:45:02 +03:00
Denis Zharkov b0ebbe99d6 Fix coroutine-related VerifyError
The problem was that we spilled the `origin` variable (see test) as Object, because
we determined the type of merge(null, String) incorrectly.

 #KT-15973 Fixed
2017-01-30 15:45:02 +03:00
Zalim Bashorov 0dd3f11175 KJS: mark as inline only some functions form js stdlib 2017-01-30 15:35:45 +03:00
Zalim Bashorov a49ad3ca69 KJS: change visibility of subSequence helper function to internal to avoid to use it directly from kotlin 2017-01-30 15:35:45 +03:00
Zalim Bashorov d5dca38d68 KJS: rename baseClass field in metadata to interfaces since we plan to store there only implemented interfaces (see KT-15037) 2017-01-30 15:35:45 +03:00
Zalim Bashorov 1b8b6bea43 KJS: turn Json class into external interface
#KT-12712 Fixed
2017-01-30 15:35:45 +03:00
Dmitry Jemerov 3a3cf048a6 Register ControlFlowFactory in KotlinCoreProjectEnvironment
#KT-16047 Fixed
2017-01-30 13:22:47 +01:00
Dmitry Jemerov f0e890797a Disable "Create type alias from usage" fix when language level doesn't support type aliases
#KT-16036 Fixed
2017-01-30 12:37:31 +01:00
Dmitry Jemerov 17c73cea7f Disable "Introduce type alias" refactoring when type aliases aren't supported by the current language level 2017-01-30 12:37:31 +01:00
Dmitry Jemerov 720da176db Exclude keywords from completion if the corresponding feature is unsupported by the language level selected for the module 2017-01-30 12:32:41 +01:00
Alexander Udalov eb61a1c5a8 Make KTypeProjection's constructor public
To make it easier to create a KTypeProjection instance given a KVariance
instance (otherwise you currently need to do a "when" on it). Also it's exposed
via automatically generated "copy" anyway
2017-01-30 11:31:20 +03:00
Alexander Udalov e5680565b3 JS: drop "-kjsm" flag, merge logic with "-meta-info"
#KT-16049 Fixed
2017-01-30 11:31:03 +03:00
Alexander Udalov 17b0b7704f JS: minor, drop obsolete VFS_PROTOCOL 2017-01-30 11:31:02 +03:00
Alexander Udalov ef42e3e4aa JS: write full version (major.minor.patch) to .meta.js 2017-01-30 11:31:02 +03:00
Alexander Udalov 038e4da83c Do not crash JS decompiler on non-existing .jar entries
See the comment for clarification
2017-01-30 11:31:02 +03:00
Alexander Udalov b5fef84e9c Update tests on decompiled text for JS
Because .kjsm files now contain all declarations from the package (contrary to
the JVM decompiler which produces one file for one class/package facade), some
common decompiled text tests started to behave differently on JVM and JS.
Update two of them (Modifiers, ClassWithClassObject) to make results the same,
copy another (TypeAliases) to JVM-/JS-specific tests with different outputs
2017-01-30 11:31:02 +03:00
Alexander Udalov 805e3e4d0f Drop tests on JS decompiled text / stub consistency
They're no longer needed because the logic of the decompiler / stub builder is
now trivial (see KotlinJavaScriptDeserializerForDecompiler,
KotlinJavaScriptStubBuilder) and after it's merged to the decompiler for
built-ins, it's going to be tested anyway with BuiltInDecompilerConsistencyTest
2017-01-30 11:31:02 +03:00
Alexander Udalov 1045689911 JS: simplify KotlinJavascriptSerializationUtil
Inline recently introduced SerializerCallbacks
2017-01-30 11:31:02 +03:00
Alexander Udalov 63c24c56ec JS: serialize .kjsm package-wise, adapt decompiler & stub builder
Instead of multiple .kjsm files for different classes and .kotlin_string_table,
.kotlin_file_table, .kotlin_classes files for each package, serialize the
contents of each package to a single foo/bar/baz/baz.kjsm file. The short name
of the file is the last segment in the FQ name of the package, or
"root-package" if the package is root.

There are two main reasons for this change:
1) Such structure takes less space, is more IO-friendly and will not cause
   multiple exceptions as the old one, where we sometimes tried to read
   non-existing files
2) This is exactly the same format that is used to serialize built-in
   declarations (.kotlin_builtins) at the moment, which will allow us to reuse
   some code

Also write a separate Header protobuf message to the beginning of the .kjsm
file. This will be used as arguments of the kotlin.Metadata annotation are used
in the JVM-specific parts of the compiler: to be able to provide some general
information about the binary file without parsing the whole protobuf data.

This commit breaks decompiled text & stub builder consistency tests. This is OK
because they're removed in a future commit.

Fixes EA-79605, EA-81947, EA-84277 and maybe EA-86787

 #KT-10894 Fixed
 #KT-14124 Fixed
 #KT-15755 Fixed
2017-01-30 11:31:02 +03:00
Alexander Udalov 46bf057b47 JS: do not generate .meta.js and .kjsm for built-ins 2017-01-30 11:31:02 +03:00
Alexander Udalov 4b81dfb7c1 JS: improve binary representation format of metadata in .meta.js
Instead of writing many different files and serializing this "virtual file
system" to a byte array in a protobuf message, just write the needed stuff
directly, as fields in the Library message. Make it consist of many Part
messages, where the Part message is equivalent to the BuiltIns message in
builtins.proto. The next step would be to combine Library.Part and BuiltIns,
which will allow us to simplify some serialization-related code soon.

In this commit, no changes happened to the .kjsm format. But since the code
that serialized the abovementioned files was shared, a temporary abstraction
over two serialization formats was made, see SerializerCallbacks.

This commit temporarily breaks .kjsm decompiler and stub builder
2017-01-30 11:31:01 +03:00
Dmitry Petrov 77ea0614f9 Fix testData in smart completion test
(abbreviation is preserved for 'arrayListOf').
2017-01-30 10:51:47 +03:00
Vyacheslav Gerasimov 7bd6314ee1 Implemented building Kotlin Android projects with Jack toolchain enabled
#KT-13275 Fixed
Implemented KotlinJillTask for converting kotlin classes to jace format which could be consumed by Jack transform task
2017-01-29 23:39:53 +03:00