Commit Graph

47910 Commits

Author SHA1 Message Date
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
Pavel V. Talanov 3d91d4b865 Minor: expand dsl highlighting test cases to cover member functions 2018-08-16 13:59:37 +02:00
Pavel V. Talanov e9a9f2a1aa Dsl highlighting: support highlighting properties
Fix properties not being highlighted
Fix test infrastructure to verify actual output of highlighting visitors
2018-08-16 13:59:37 +02:00
Pavel V. Talanov c250f7fca4 Add debug information on any of ResolutionFacade API failures 2018-08-16 13:56:28 +02:00
Sergey Rostov f09364e654 Kotlin facet UI, JS: Hide "Enable incremental compilation (experimental)".
This option is project-wide only, so it should be visible only in project settings.
#KT-26095 Fixed.
2018-08-16 10:51:36 +03:00
Ilya Gorbunov ebc64da52a Update EXPECTED_REACHABLE_NODES after introducing top-level comparator
#KT-18067
2018-08-15 21:28:57 +03:00
Ilya Gorbunov ed53983e1e Add support for CASE_INSENSITIVE_ORDER in JS and common
#KT-18067
2018-08-15 21:28:54 +03:00
Ilya Gorbunov 6866f5d19a Move test and cover more cases of string comparison
#KT-18067
2018-08-15 21:28:50 +03:00
Ilya Gorbunov 27dde5f730 String.compareTo: SinceKotlin in JS and common, restore default parameter value in JVM
Default parameter is required to generate docs with Dokka for now.

#KT-18067
2018-08-15 21:28:47 +03:00
Toshiaki Kameyama f05a19aafb JS stdlib: implement String.compareTo with ignoreCase
#KT-18067 Fixed
2018-08-15 21:28:44 +03:00
Alexey Sedunov d194893012 MPP: Add production module dependencies to the test one (new MPP import)
#KT-25985 In Progress
2018-08-15 18:21:53 +03:00
Alexey Sedunov 443f8b6f02 Minor: Fix test data 2018-08-15 18:21:53 +03:00
Svyatoslav Kuzmich f5a80a30f7 Mute and unmute tests 2018-08-15 18:20:07 +03:00
Sergey Igushkin d13ca38296 Relax some restrictions on Gradle dependency configurations in new MPP
* Set canBeConsumed = false only on those configurations that have this
  flag according to the Gradle Java plugins. This saves us from breaking
  existing build scripts but introduces ambiguity between consumable
  configurations (e.g. between `apiElements`, `compile`, `runtime`). See
  the solution in the next point.

* Don't set the Kotlin platform attribute on configurations that are
  not meant for consuming in other projects or resolving directly. This
  change hides these configurations from Gradle's variant aware
  dependency resolution and therefore prevents ambiguity

(cherry-picked from 81f2c48f)
2018-08-15 17:48:44 +03:00
Georgy Bronnikov 00da193167 Introduce IrDeclarationWithVisibility 2018-08-15 16:56:16 +03:00
Dmitry Petrov 8e95ecb821 Use underlying type when computing type mapping mode for inline classes 2018-08-15 15:37:46 +03:00
Dmitry Petrov 948e72f653 Inline classes can only implement interfaces 2018-08-15 15:32:50 +03:00
Ilmir Usmanov 1c098bf5cf Minor. Fix test 2018-08-15 14:23:33 +03:00
Ilmir Usmanov b4189d9e85 Minor. Use more granular assertion levels in assertion tests 2018-08-15 14:23:30 +03:00
Mikhael Bogdanov 1a1bb53381 Update IR text test
Additional implicit coercions to unit was added
2018-08-15 14:18:15 +03:00
Ilmir Usmanov 300876348a Fix line numbers generation for coerced primitives
in coroutines
 #KT-25076: Fixed
2018-08-15 13:47:45 +03:00
Ilmir Usmanov a470fd21ca Eliminate only first {ASTORE, ALOAD} in locals elimination
of ALOAD.
 #KT-25912: Fixed.
2018-08-15 13:45:24 +03:00
Svyatoslav Kuzmich ff70b837ee [JS IR BE] Support local delegated properties 2018-08-15 13:35:14 +03:00