Commit Graph

59145 Commits

Author SHA1 Message Date
Ilya Chernikov 27ff2d7816 Prohibit using array based on non-reified type parameters as reified type arguments
#KT-31227 fixed
2019-11-18 09:32:52 +01:00
Andrey Uskov 8a1f8714e7 Fix GradleConfiguratorTest
Kotlin gradle plugin was removed from test classpath
2019-11-18 11:26:13 +03:00
Mikhail Zarechenskiy 43d916e92d [NI] Add tests for obsolete issues
#KT-26303 Obsolete
 #KT-32205 Obsolete
2019-11-18 10:25:41 +03:00
victor.petukhov cf161f8234 Rework notForIncompletionCall test 2019-11-17 15:19:28 +03:00
pyos ba93bdb14d JVM_IR: keep the $default suffix for stubs for @JvmName functions
Technically a backwards compatibility problem, as the new backend
*consistently* renamed `f$default` on `f` with `@JvmName("g")` to
`g` instead of `g$default`, so it all worked out. However, this
breaks when encountering libraries compiled with the non-IR backend.
2019-11-15 17:40:52 +01:00
Steven Schäfer 23dfade24f JVM IR: Fix inlining of inline class properties in external modules 2019-11-15 17:30:16 +01:00
Vladimir Dolzhenko fa62d0c325 Don't clear InBlockModifications on CanceledException
#KT-34914 Fixed
2019-11-15 15:48:27 +01:00
Pavel Kirpichenkov 92dae5d8a9 [NI] Split substitution of inferred type parametes into two steps
Substituting inferred type parameters with single substitutor leads
to incorrect behaviour in cases, when class' type parameters are used in constructor.
As a side effect of two-step substitution, intermediate descriptor is created,
which prevents incorrect substitution. To preserve this side effect, single
resulting substitutor was split into two substitutors: one for substituting fresh
variables and another for substituting inferred variables and known parameters.

^KT-32415 Fixed
2019-11-15 16:58:32 +03:00
Pavel Kirpichenkov b6af13f18d [NI] Add missing substitution of known type parameters
Known type parameters appear after inheriting from class with type
parameters. Their substitution matters for inner class constructor,
because without substitution it's parameters will be type checked
against incorrect (original) parameter descriptor with unsubstituted
type parameters.

Skip creation of composite substitutor, if old substitutor is empty.

New substitutors return null in case they don't substitute a type,
but old type substitutors have explicit isEmpty method. Composite
substitutor with empty old substitutor leads to creation
of incorrect descriptor copies.
2019-11-15 16:58:07 +03:00
Pavel Kirpichenkov 3122f2704c [Minor] Refactor resulting descriptor substitution in call transformer 2019-11-15 16:58:07 +03:00
Pavel Kirpichenkov ea66f02035 [Minor] Rename fresh variable substitutor in resolved atom 2019-11-15 16:58:07 +03:00
victor.petukhov 25f3de2085 Use more stable kotlin dependency in tests for enabling inline classes flag 2019-11-15 16:13:44 +03:00
Sergey Bogolepov 4438dd282f [kotlinx-metadata-klib] Bugfixes:
1. Add dependency on `:core:descriptors`
2. Wrap module name with < and >
3. Remove redundant question marks.
4. Fix string table writing.
2019-11-15 19:10:30 +07:00
Sergey Bogolepov 95399b3a41 Introduce kotlinx-metadata-klib.
`kotlinx-metadata-klib` is an extension of `kotlinx-metadata` that can be used to read and write metadata that is stored inside KLIBs.
Note: current version is in its early days and in active development. Almost nothing is stable or properly tested.
2019-11-15 16:38:07 +07:00
Ilya Gorbunov d91453fb7a Do not preprocess apiVersionIsAtLeast calls inlined into kotlin package
If such call were to be inlined into an inline function in kotlin
package, it would be expanded there preventing the further expansion in
client code.
2019-11-15 05:22:24 +03:00
Andrey Uskov 352a10a0ed Do not fail tests on unknown version of gradle Kotlin plugin 2019-11-14 21:13:21 +03:00
Andrey Uskov e963b71921 Tests of import with latest gradle plugin are implemented 2019-11-14 21:13:19 +03:00
Andrey Uskov 51590ef1b7 Migrate import tests to annotation-driven determination of target
kotlin plugin versions
2019-11-14 21:13:16 +03:00
Andrey Uskov d05f893233 Import tests with gradle 5.6.4 were added 2019-11-14 21:13:13 +03:00
Andrey Uskov a51e2ca4d6 Limit initial heap of gradle daemon in import tests 2019-11-14 21:13:11 +03:00
Andrey Uskov 1f2767ae21 Remove gradle testing import from gradle 3.x 2019-11-14 21:13:09 +03:00
Andrey Uskov 48f6207d26 Support annotation-based declaration of target plugin and gradle version
in gradle importing tests
2019-11-14 21:13:07 +03:00
Andrey Uskov 14aa0eae71 Extract kotlin gradle plugin versions to constants in tests 2019-11-14 21:13:05 +03:00
Roman Golyshev 633005fb57 KT-25732 Perform keywords completion earlier to complete them before freeze
- If you complete keywords too late, the completion list may become frozen, and `null` will never make it to the top of it
- Remove `flushToResultSet` between `addReferenceVariantElements` calls because flush already happens inside of them
- ^KT-25732 Fixed
2019-11-14 19:50:38 +03:00
Alexander Udalov 36ca280b86 Fix compilation error in ResolveInlineCalls.kt 2019-11-14 17:19:27 +01:00
Mikhail Glukhikh 635add4823 FIR substitution: generate fake overrides for accessor symbols 2019-11-14 19:10:59 +03:00
Mikhail Glukhikh bd70daa3d1 FIR Java: use definitely not-null types for type parameters
We support & use ConeDefinitelyNotNullType more properly here
2019-11-14 19:10:59 +03:00
Mikhail Glukhikh 63f38bb28a FIR [rendering only]: render fake overrides for properties 2019-11-14 19:10:58 +03:00
Dmitriy Novozhilov 4733c78a6a [FIR] Add toString() to ErrorTypeConstructor and ConeClassifierLookupTag 2019-11-14 18:33:47 +03:00
Dmitriy Novozhilov 944be132de [FIR-TEST] Add test with calling constructor of type with aliased import 2019-11-14 18:33:47 +03:00
Dmitriy Novozhilov d9fe70f97c [FIR] Fix binding overrides with flexible types in arguments 2019-11-14 18:33:47 +03:00
Dmitriy Novozhilov 3a7251a90b [FIR-TEST] Add test with problems in mapping getter name to property name 2019-11-14 18:33:47 +03:00
Dmitriy Novozhilov 6f9e576502 [FIR-TEST] Add test with ambiguity on accidental override property 2019-11-14 18:33:47 +03:00
Dmitriy Novozhilov f43d77d422 [FIR-TEST] Move nestedClassConstructor test to problems test suite 2019-11-14 18:33:47 +03:00
Dmitriy Novozhilov 2409a74fb5 [FIR-TEST] Add test for problem with += and java synthetic property 2019-11-14 18:33:46 +03:00
Dmitriy Novozhilov 11063a25a8 [FIR] Replace FirEmptyDiagnostic with FirStubDiagnostic
FirStubDiagnostic hold reason from original diagnostic
It's useful in HTML fir dump
2019-11-14 18:33:46 +03:00
Dmitriy Novozhilov ee20f88837 [FIR] Propagate smartcasts in safe calls chain 2019-11-14 18:33:46 +03:00
Dmitriy Novozhilov 833648d8e0 [FIR] Fix smartcasts on receivers of implict invoke call 2019-11-14 18:33:46 +03:00
Dmitriy Novozhilov 660bcce90a [FIR] Add smartcasts for reassigned vars 2019-11-14 18:33:46 +03:00
Dmitriy Novozhilov 2a74e37e28 [FIR] Ignore expected type for resolve constant expressions 2019-11-14 18:33:46 +03:00
Dmitriy Novozhilov 6a3c07688f Add print of detailed stack trace to NonFir modularized test 2019-11-14 18:33:46 +03:00
pyos a235dd2891 IR: move defaultParameterDeclarationsCache access up one level
to avoid recomputing overriddenSymbols for fake overrides of default
stubs on repeated calls to generateDefaultsFunction.
2019-11-14 17:41:47 +03:00
pyos 70f09a7531 IR: make DefaultArgumentStubGenerator a few lines shorter 2019-11-14 17:41:47 +03:00
pyos 2b2dd097a3 IR: refactor DefaultParameterInjector 2019-11-14 17:41:47 +03:00
pyos 7a2715da44 IR: refactor generateDefaultsFunction
The check for whether a function needs a default stub should run fewer
times now, and in particular is no longer quadratic. Also, this fixes
a weirdness in that certain inheritance hierarchies would produce
a default stub that points to a non-stub through its overriddenSymbols
field.
2019-11-14 17:41:47 +03:00
pyos 29a14e2330 JVM_IR: resolve inline fake overrides before codegen
See KT-33054 and KT-29242.
2019-11-14 15:29:24 +01:00
Dmitriy Dolovov 1b2091d536 Fix: KLIB reading error on Windows
Issue #KT-34909
2019-11-14 20:37:43 +07:00
Ilya Goncharov 77950c5410 [Gradle, JS] Remove redundant from kotlin-test-js-runner 2019-11-14 16:03:54 +03:00
Ilya Goncharov 6a6bef0f6c [Debugger, JS] Remove kotlin source map support from tests and build 2019-11-14 15:53:18 +03:00
Ilya Goncharov 35cb412dc3 [Gradle, JS] Fix source map support initializing for mocha 2019-11-14 15:53:18 +03:00