Commit Graph

47932 Commits

Author SHA1 Message Date
Vitaliy.Bibaev 5fe0f167ca Simplify checks that stream chain exists 2018-08-20 05:17:43 +03:00
Vitaliy.Bibaev 6d395dffbb Move stream call checks into separate class 2018-08-20 05:17:43 +03:00
Vitaliy.Bibaev 64f399235e Add tests for kotlin language support in the expressions dsl 2018-08-20 05:17:43 +03:00
Vitaliy.Bibaev 8185354116 Add streamex support 2018-08-20 05:17:43 +03:00
Vitaliy.Bibaev 3a2370a2d6 Minor: add a forgotten file 2018-08-20 05:17:43 +03:00
Vitaliy.Bibaev ea3206bba4 Minor: fix compatible issue 2018-08-20 05:17:42 +03:00
Vitaliy.Bibaev 2c57853dbe Add an extension point to support standard library in kotlin 2018-08-20 05:17:42 +03:00
Vitaliy.Bibaev 957f9a7e14 Add source files 2018-08-20 05:17:42 +03:00
Nikolay Krasko 8f566132e4 Workaround for IndexNotReadyException from icon provider (EA-118965)
Provider is DumbAware and isn't expected to access indexes.
2018-08-19 17:44:42 +03:00
ilmat192 2251440f04 Basic native support in kotlin-multiplatform (#1811)
* Add dependency on KN shared in gradle-plugin

* Basic support for Kotlin/Native:
     * Target presets
     * Compilation into a klib
     * Compilation into native binraies: framework and executable
     * Basic dependencies between projects
     * No jars in native publications
     * Replace '-' with '_' in framework names
    * Escape quotes in native command lines on Windows
* Move targets from Kotlin/Native repo
* Download KN compiler using Gradle's mechanisms
* Support source set dependencies in native
2018-08-19 20:45:31 +07:00
Zalim Bashorov 8966e220f0 Update tests 2018-08-17 21:44:08 +03:00
Zalim Bashorov c61d99fcff [JS IR BE] don't initialize instance storage for singletons explicitly, use default value (undefined) instead
It allows accessing to a singleton independent to the state of its storage.
2018-08-17 21:43:33 +03:00
Zalim Bashorov 0f6a77e700 [JS IR BE] take into account receiver's type when generate name for callables (including properties)
Also, add special markers for receiver type and generic types to avoid accidental clashes.
2018-08-17 20:31:06 +03:00
Mikhail Glukhikh b9d6580b44 Introduce MPP wizard for web (JVM / JS) applications
This implements first part of KT-25952
2018-08-17 18:16:34 +03:00
Mikhail Glukhikh b10554a8a0 Make old MPP wizard deprecated 2018-08-17 18:16:11 +03:00
Mikhail Glukhikh 57153cc2fc Make code in IntroduceIndexMatcher safer
EA-101119 Fixed
2018-08-17 18:16:10 +03:00
Mikhail Glukhikh d67dea4619 Reformat & cleanup: CreateCallableFromCallActionFactory 2018-08-17 18:16:08 +03:00
Mikhail Glukhikh 9a9e703e80 Do not suggest "create abstract property" inside annotation 2018-08-17 18:16:07 +03:00
Mikhail Glukhikh 04675b4446 Do not suggest "create local variable" inside primary constructor
#KT-26158 Fixed
EA-99300 Fixed
2018-08-17 18:15:47 +03:00
Mikhail Glukhikh 34be9ccbbe Reformat: CreateLocalVariableActionFactory 2018-08-17 18:15:44 +03:00
Sergey Igushkin b125f1e23e Revert "Fix source set resources filtering broken by refactoring"
This reverts commit 6af6834
2018-08-17 17:54:43 +03:00
Alexander Udalov 92e7fe347a Minor, provide more info when deserializing bad constant value 2018-08-17 16:31:54 +02:00
Ilmir Usmanov 2ecea55cb1 Ignore coroutines and assertion tests in android tests generator
for now.
2018-08-17 16:17:19 +03:00
Ilmir Usmanov dcfdc781db Minor. Unmute test in JS BE 2018-08-17 16:14:28 +03:00
Anton Bannykh 8e5b2fe657 JS: create appropriate nameBinding's upon inlining
Otherwise JsName's don't get linked properly upon deserialization.
As a result a function/constructor doesn't get renamed at
call site during the name conflict resolution phase.
2018-08-17 15:27:00 +03:00
Alexey Tsvetkov 3b4a49eebf Add test for KT-26064 2018-08-17 15:27:00 +03:00
Sergey Igushkin 1a3dd67176 Enable metadata publishing for new MPP and consumption from source sets
* Add configurations for consuming source sets metadata (extending the
  source set's dependency configurations). These configurations will be
  used by the IDE to pick up the dependencies metadata.

* Remove the universal preset from the default presets, create a
  metadata target by default for compiling and publishing the metadata
  of `commonMain` (in the future, we will publish and consume the
  metadata of the other source sets as well).

* Make the classpath configurations of common modules consume the
  metadata and thus ensure compatibility of 1.2.x MPP with the new MPP
  model.
2018-08-17 15:12:44 +03:00
Vyacheslav Gerasimov add323a486 as33: Remove incorrect gradle.xml.as33 2018-08-17 14:39:03 +03:00
Ilya Chernikov 2a4cef3ac2 Avoid "Failed to initialize native filesystem for Windows" warning from the platform on script compilation 2018-08-17 09:49:46 +02:00
Jonathan Lermitage 66bb744e3c Update Maven central repository url to latest version 2018-08-17 09:46:07 +02:00
Sergey Igushkin 6af6834966 (minor) Fix source set resources filtering broken by refactoring
Before the last change in this logic, the resources filtering used
the original Kotlin source directories, not those with Java filtered
out.

Make sure that the Java source directories that are added to the Kotlin
source set are excluded from the resources, and all the related
configuration works lazily, i.e. supports source sets modification
after configuration took place.
2018-08-17 03:22:30 +03:00
Sergey Igushkin d1a5794d36 (minor) Move source set configuration creation
It was placed in the new MPP plugin and was therefore not used for
the 'KotlinSourceSet's with the old plugin. Move this logic to the
KotlinSourceSetFactory so that it is applied to all source sets
2018-08-17 03:18:32 +03:00
Pavel V. Talanov 42f39a3ea4 Use older utility to fix compilation for as31 and 173 branches 2018-08-16 16:33:49 +02:00
Ilya Chernikov ac65aebb19 Direct mapping of script implicit receivers and env vars to parameters 2018-08-16 15:13:00 +02:00
Ilya Chernikov e1ee31b4ce Use linked hashmap in properties dsl - preserving order 2018-08-16 15:13:00 +02:00
Alexander Udalov ddb398645b Reformat modules 'metadata' and 'metadata.jvm', fix some inspections 2018-08-16 15:08:18 +02:00
Alexander Udalov 3345dc81fd Do not return field signature if there's none in the metadata
Otherwise this code behaves incorrectly on getter-only properties: it
returns a meaningless field signature whereas the property has no field.
It's hard to come up with an example of when this could matter in
compiler code, but it's very noticeable in kotlinx-metadata-jvm

 #KT-26188 Fixed
2018-08-16 15:05:19 +02:00
Alexander Udalov 3f32e1cce9 Do not serialize empty property signature to JVM metadata
This should have no effect on the correct code currently because all
properties have at least a getter, but may help in debugging problems
with serialized metadata for properties
2018-08-16 14:11:09 +02:00
Alexander Udalov bba25042b6 Fix generation of metadata for const val field in multi-file class
Metadata for declarations in multi-file classes is always written to the
corresponding parts, but fields for public const vals are generated into
the facade class.

Before this change, we ran generateBackingField only to generate the
const val field in the facade (because isBackingFieldOwner is true only
for the facade). Besides generating the actual field,
generateBackingField also stores the mapping to the FIELD_FOR_PROPERTY
slice, which is used later in the serializer to serialize the correct
JVM signature of the field to the metadata. However, the mapping was
stored to the incorrect binding map! Namely, the map from the same
ClassBuilder that is used to generate the class, and that is the facade
class builder. But the metadata needs to be generated to the part class,
not the facade.

Surprisingly, there is a test at
reflection/multifileClasses/javaFieldForVarAndConstVal.kt that checks
that kotlin-reflect is able to load the field signature of a const val
in a multi-file class, which is the main use case of this information,
and it passed before this change. The reason the test passed is that
KPropertyImpl.javaField uses JvmProtoBufUtil.getJvmFieldSignature which
mistakenly treats the absence of the field signature in the proto as the
hint that it may be computed naively (just the property's name + naively
mapped type), whereas in fact the field signature was missing
completely. (The fact that absence of a message may mean two things is
certainly a shortcoming of the metadata format and should be revisited
in the future.) This never led to any problem in the real world because
it's easy to prove that the field signature of a const val can always be
computed naively.

After this change, we now run generateBackingField twice: for the
facade's class builder, and for the part's class builder. The actual
field is only generated in the former case. But the mapping computed in
the latter case is used correctly in JvmSerializerExtension to store the
field signature to metadata. Also refactor
generateSyntheticMethodIfNeeded in the similar way, to reduce the number
of `if`s.
2018-08-16 14:11:09 +02:00
Alexander Udalov b9594988ea Do not read property getter/setter signature if it's empty
This has no effect on the correct code currently, but will help in
debugging when changing the serialized metadata for properties.

For example, if after some change an empty propertySignature extension
is written for Property (it's possible for PropertyDescriptor without
getter or setter and without backing field), we now won't try to read a
missing getter message when loading annotations on property getter. In
protobuf, reading a missing message will result not in an exception, but
in a "default" message being returned, which makes no sense in our case
because it would simply be read as a getter signature with both "name"
and "desc" equal to 0 (i.e. the first entry in the string table)
2018-08-16 14:11:09 +02:00
Dmitry Petrov b6e3218ca2 Use mapping mode for inline class underlying type without wrapping 2018-08-16 15:03:50 +03:00
Dmitry Petrov 06ef8824b6 Minor: reformat 2018-08-16 15:03:50 +03:00
Pavel V. Talanov 5ad8405893 Tweak test data so MultiFileHighlighting does not fail
Actually this test has to be reviewed
Current failures are caused by change in platform API
2018-08-16 14:03:01 +02:00
Pavel V. Talanov 8e470c7c4c Fix test data
Order of members returned by platform changed
Fix test files so test result would not depends on this order
2018-08-16 14:03:01 +02:00
Pavel V. Talanov b59f134f78 Fix completing members for receivers shadowed by DslMarker
#KT-20396 Fixed
2018-08-16 13:59:38 +02:00
Pavel V. Talanov 0c1d25d5ac Completion: when Unit is expected do not prioritize by return type
Decide on completion order by other factors
Previously would prefer callable that return Unit if Unit is the expected type
    leading to strange completion order

 #KT-25588 Fixed
2018-08-16 13:59:38 +02:00
Pavel V. Talanov 51681d57c8 Minor: toString() for CompoundWeight to improve test results readability 2018-08-16 13:59:38 +02:00
Pavel V. Talanov b51c021f56 Dsl completion: assign high priority for dsl elements that are members 2018-08-16 13:59:37 +02:00
Pavel V. Talanov af2a6a5096 Support dsl highlighting for object references 2018-08-16 13:59:37 +02:00
Pavel V. Talanov f80b85c282 Minor, refactor TypeKindHighlightingVisitor 2018-08-16 13:59:37 +02:00