Commit Graph

63099 Commits

Author SHA1 Message Date
Zalim Bashorov d07436c831 [IDE KJS] Move JsResolverForModuleFactory to proper place 2020-03-20 01:27:41 +03:00
Zalim Bashorov eaac5bdac4 [IDE KN] Treat klib as Kotlin/Native library iff manifest contains builtins_platform==NATIVE 2020-03-20 01:27:41 +03:00
Vladimir Dolzhenko d247dd21de Added missed :compiler:fir:checkers dependency for kotlin-plugin 2020-03-19 22:26:17 +01:00
Dmitriy Novozhilov c4b8e94061 [FIR] Add utils for traversing control flow graph 2020-03-19 23:11:18 +03:00
Dmitriy Novozhilov b88cb3f849 [FIR] Add visitors for control flow graph 2020-03-19 23:11:17 +03:00
Dmitriy Novozhilov e4588c3dec [FIR] Add diagnostic component for control flow analysis 2020-03-19 23:11:17 +03:00
Dmitriy Novozhilov 9535df5e2e [FIR] Add owner to ControlFlowGraph 2020-03-19 23:11:17 +03:00
Dmitriy Novozhilov 496489cdf4 [FIR] Introduce CheckerContext for call and declaration checkers 2020-03-19 23:11:17 +03:00
Dmitriy Novozhilov 1c87601486 [FIR] Split ImplicitReceiverStack to mutable and immutable parts 2020-03-19 23:11:17 +03:00
Victor Petukhov 3b892fe31e NI: exclude reporting of an unsafe call diagnostic for implicit invoke after safe call in cases when invoke has type parameters (make NI and OI consistent)
^KT-37579 Fixed
2020-03-19 19:27:25 +03:00
Mikhail Bogdanov 8b330193ac Minor. Throw proper exception in test framework on directive processing 2020-03-19 16:45:11 +01:00
Mikhail Bogdanov 3f87899014 Switch converter test to new directive scheme 2020-03-19 16:45:10 +01:00
Mikhail Bogdanov d793fea8d2 Use multimap for directives 2020-03-19 16:45:10 +01:00
Mikhail Bogdanov 420dd0d440 Extract directive map to separate class 2020-03-19 16:45:10 +01:00
Mikhail Bogdanov bc214868ef Minor. Clean tests 2020-03-19 16:45:10 +01:00
Mikhael Bogdanov ab7e71fd68 Support per files test directives 2020-03-19 16:45:10 +01:00
Mikhael Bogdanov 34547b4e27 Minor. Remove redundant getters 2020-03-19 16:45:10 +01:00
Vyacheslav Gerasimov 507b00ee77 201: Fix kotlin-compiler proguard 2020-03-19 18:13:51 +03:00
Ilmir Usmanov be87d5fab5 JVM_IR: Serialization: do not mess with return types of call expressions
If return type of IrConstructor is different from containing class, we will
generate call to wrong <init> method, leading to VerifyError.
If we do not specify the type of irNull, it, by default, will be Nothing?,
when really we need Any?. This leads to CCE: cannot cast to Void at runtime.
2020-03-19 15:18:32 +01:00
pyos d06c87207c Dump class structure in a test that has an object in a lambda 2020-03-19 15:11:20 +01:00
pyos e0a5ab7146 Do not regenerate objects if all captured lambdas are noinline 2020-03-19 15:11:20 +01:00
pyos 54e725668f Ignore reified type parameters when regenerating objects from lambdas
All reified type parameters referenced by objects in non-default lambdas
are from outside the inline call, thus they cannot be substituted yet.
This means if the only reason for object regeneration is reification,
then regeneration isn't actually necessary.

E.g. in this code:

    inline fun <reified T> f(x: () -> Unit) = x()
    inline fun <reified V> g() = f<V> { { println(V::class.simpleName) }() }

we first inline the lambda into f(), then inline f()-with-lambda into g().
Because the object inside the lambda captures nothing from outside g(),
the original class can be used both times.

This brings the JVM_IR backend into complete compliance with KT-28064.
2020-03-19 15:11:20 +01:00
Mikhail Glukhikh 1fd3ac046a [FIR] Throw exception if PSI type in ConeDiagnostic helper is improper 2020-03-19 16:57:52 +03:00
Mikhail Glukhikh 50a9313a5e [FIR] Support some approximation of effective visibility 2020-03-19 16:56:47 +03:00
Dmitry Gridin cb3a31af6e UAST: implement KotlinUastCodeGenerationPlugin for 201
#KT-37569 Fixed
2020-03-19 16:58:58 +07:00
Victor Petukhov 81385b73b7 NI: limit cache size for approximated types during incorporation 2020-03-19 12:47:48 +03:00
Victor Petukhov ea59ea8aa2 NI: avoid creating useless captured types during incorporation
^KT-37546 Fixed
2020-03-19 12:47:03 +03:00
Victor Turansky e34dd27a34 KT-37240 Use extension "extension" 2020-03-19 11:55:24 +03:00
Victor Turansky 90c993334f KT-37240 Deterministic order for webpack config patches
Additional fix - only files with `js` extension processed (directories excluded)

`listFiles()` already contains 'is directory' check. Duplicated check removed
2020-03-19 11:55:24 +03:00
Pavel Punegov 8ffb63ca6b Ignore test that relies on hashCode implementation 2020-03-19 11:14:58 +03:00
Jinseong Jeon 2352b1fec5 JVM_IR: use fresh source map when generating lambda body for inline. 2020-03-19 08:28:38 +01:00
pyos 72b80ef158 Detect inline cycles faster
E.g. in the following code

    fun x() {}
    inline fun f() { x(); g() }
    inline fun g() { x(); f() }

the old implementation of inline cycle detection bailed out after
generating 3 calls of x() in each function, while the new one stops
after 2. In other words, code generation for a single function is no
longer reentered.
2020-03-19 08:13:19 +01:00
Dmitriy Novozhilov 39372c06cf [FIR] Move all checkers and theirs infrastructure to separate module 2020-03-19 09:51:01 +03:00
Dmitriy Novozhilov cc07ae96b3 [FIR-TEST] Move analysis tests to separate module 2020-03-19 09:51:01 +03:00
Dmitriy Novozhilov 3a479d5d16 [FIR-TEST] Move FIR ide tests to separate module 2020-03-19 09:51:00 +03:00
Vyacheslav Gerasimov bcefa68df0 Always checkout/checkin text files with lf endings
Different line endings on linux/windows prevents gradle from reusing
build cache since endings make task inputs completely different between
systems
2020-03-18 22:33:15 +03:00
Vyacheslav Gerasimov 7dc24a13e4 Build: Make ProGuard task cacheable
Exclude jdk files form libraries input. Instead add jdk major version
to inputs. JavaCompile task acts same to ignore fluctuations in JDK
implementations since api should remain same
2020-03-18 22:32:07 +03:00
Jiaxiang Chen 03613d4708 JVM_IR: preserve old backend's logic for special mutable collection class stub methods 2020-03-18 19:28:04 +01:00
Ilya Chernikov da1009eb2c Avoid type approximation on generating equality constraints
#KT-37389 fixed
2020-03-18 18:34:09 +01:00
Ilya Chernikov 950ab01596 Avoid substitution and type approximation for simple calls
#KT-37392 fixed
2020-03-18 18:34:09 +01:00
Vladimir Dolzhenko e1ae81e0a1 Run inspections after completion of general highlight pass in 201
#KT-37553 Fixed
2020-03-18 18:08:54 +01:00
Vladimir Dolzhenko 3cdcdbf6a8 Register Kotlin specific highlight passes via highlightingPassFactory in 193+ 2020-03-18 18:08:54 +01:00
Vladimir Dolzhenko 2e20cdf2e6 Update to 201.6487-EAP-CANDIDATE-SNAPSHOT 2020-03-18 18:08:54 +01:00
Mikhail Glukhikh d0319d6b31 [FIR2IR] Use FirSourceElement.elementType instead of PSI 2020-03-18 17:09:37 +03:00
Mikhail Glukhikh 26a63a45ee Introduce FirSourceElement.elementType 2020-03-18 17:09:37 +03:00
Mikhail Glukhikh 25ab863af7 Add FlyweightCapableTreeStructure to FirLightSourceElement & use it 2020-03-18 17:09:37 +03:00
Mikhail Glukhikh 59fb96503c Introduce FirModifierList 2020-03-18 17:09:37 +03:00
Mikhail Glukhikh 6739135d17 [FIR2IR] Add pre-caching of built-in classes to avoid their duplications 2020-03-18 17:09:37 +03:00
Mikhail Glukhikh 0bf4cac601 [FIR2IR] Unmute additional black box test after rebase 2020-03-18 17:09:37 +03:00
Mikhail Glukhikh 95108a1bce [FIR2IR] Enable type parameter index >= 0 requirement 2020-03-18 17:09:36 +03:00