Commit Graph

94854 Commits

Author SHA1 Message Date
Mads Ager ff84c19eff Make kotlin-android-extensions always cause a compilation error.
kotlin-android-extensions are deprecated and have been scheduled
for removal in 1.8.0.

https://android-developers.googleblog.com/2022/02/discontinuing-kotlin-synthetics-for-views.html
2022-09-16 15:03:01 +02:00
Pavel Kunyavskiy 7293dd6d65 [K/N] Require small binaries for all watchos targets 2022-09-16 12:24:11 +00:00
Alexander Korepanov 46afb46a6d [JS IR] Add IC test for local inline function
^KT-50739
2022-09-16 12:14:35 +02:00
Ilya Goncharov bf8681296b [Gradle, JS] IR by default and report warnings for using legacy compiler
- just legacy - report warning about deprecation
- both - report warning about deprecation of legacy
- no compiler explicitly chosen - error about explicit setting compiler

warn from cli legacy compiler

nowarn flag - kotlin.js.compiler.nowarn

KT-42326
KT-53074
2022-09-16 09:48:41 +00:00
Nikolay Krasko b53d6d0d7e Revert "[K/N] Convert StubGenerator build script to Kotlin"
This reverts commit ddc2eb79c3.
2022-09-16 11:25:18 +02:00
pyos ecdd80769e FIR: do not read a Java nested class if the outer class is Kotlin
Example: if C is a Kotlin class and there is an import of C.Companion.f,
a call to f will need to check if it is a constructor, for which
it will attempt to load C.Companion.f as a Java class. This involves
loading all outer classes, including C itself, as BinaryJavaClass - see
KotlinCliJavaFileManagerImpl - despite the fact that C and C.Companion
have both already been loaded from their Metadata annotations as Kotlin
classes, wasting cycles and polluting caches.

Thus the theoretical motivation for this change is to marginally speed
up FIR.

The real motivation is that with the -Xemit-jvm-type-annotations option,
kotlinc sometimes generates invalid annotations, and reading them with
BinaryJavaClass throws an exception (the Kotlin metadata however is
valid):

    // MODULE: lib
    // FILE: C.kt
    // The constructor has an argument of type
    //   List<? extends Function1<? super String, Integer>>
    // and a ParameterName type annotation with path
    //   TYPE_ARGUMENT(0), TYPE_ARGUMENT(0)
    // which is missing a WILDCARD between the two TYPE_ARGUMENTs
    class C(val x: List<(name: String) -> Int>) {
      companion object {
        fun foo() {}
      }
    }
    // MODULE: main(lib)
    // FILE: main.kt
    import C.Companion.f

    fun bar() = foo() // crashes FIR

The parameter annotation should obviously be fixed too, but invalid
bytecode may already exist in the wild. Also, did I mention that this
change marginally speeds up FIR?
2022-09-16 08:44:15 +00:00
Yahor Berdnikau 928e0e7fb8 Set default stdlib dependency to kotlin-stdlib-jdk8
^KT-53830 Fixed
2022-09-16 07:42:15 +00:00
Alexander Korepanov 47bbd5e8c1 [JS IR] Add work around in EnumEntriesList for JS IR to avoid name clashes
JS IR generates bridges with type checks for special class methods,
 however if parent and child type parameters are same,
 the JS signature for the generated brige will be clashed with
 the JS signature of original method.

 This patch changes type parameter name of EnumEntriesList to avoid the clash.

^KT-54011 Fixed
2022-09-16 07:19:20 +00:00
Alexander Korepanov 639af77b91 [JS IR] Invalidate IC cache after modifying language settings
^KT-54010 Fixed
2022-09-16 07:19:20 +00:00
Alexander Korepanov dd7d669464 [JS IR] Use jsOutputName for module naming when IC is enabled
^KT-53986 Fixed
2022-09-16 07:19:20 +00:00
Alexander Korepanov ef05a0d9ed [JS IR] Disable JS IR IC infrastructure when WASM is enabled 2022-09-16 07:19:19 +00:00
Alexander Korepanov 1003e4f1e1 [JS IR] Remove unused function 2022-09-16 07:19:19 +00:00
Alexander Korepanov e38f1494fc [JS IR] Enable JS IR IC by default
^KT-53112 Fixed
2022-09-16 07:19:19 +00:00
Mikhail Glukhikh a70c4f15d6 K2: make not implemented checker more close to K1 logic
#KT-54049 Fixed
2022-09-16 07:15:43 +00:00
Mikhail Glukhikh fe38089205 FE: add test reproducing KT-54049 2022-09-16 07:15:43 +00:00
Mikhail Glukhikh b86722c523 FE: delay ForbidSuperDelegationToAbstractFakeOverride to 1.9
Related to KT-53953, KT-49017
2022-09-16 07:15:43 +00:00
Mikhail Glukhikh c4a48927d2 K1: report ABSTRACT_SUPER_CALL(_WARNING) also for 2+ steps to intersection
#KT-53953 Fixed
2022-09-16 07:15:43 +00:00
Mikhail Glukhikh 3e5d5bcaa7 FE: add test reproducing KT-53953 2022-09-16 07:15:42 +00:00
Dmitriy Novozhilov ed1a1c067c [Assign plugin] Add experimentality warning 2022-09-16 10:12:41 +03:00
Anže Sodja 17cd0d7dbc [Assign plugin] Add Gradle plugin and IDE dependencies for Assignment compiler plugin 2022-09-16 10:12:41 +03:00
Anže Sodja 09d6dfc8bf [Assign plugin] Add a compiler plugin for overloading assign ('=') operator 2022-09-16 10:12:41 +03:00
Anže Sodja 6052962f50 Register AssignResolutionAltererExtension in KotlinCoreEnvironment 2022-09-16 10:12:41 +03:00
Dmitriy Novozhilov 09429ff432 [FIR] Fix reporting of UNINITIALIZED_ENUM_COMPANION in all places 2022-09-16 07:12:20 +00:00
Dmitriy Novozhilov a2c12aa711 [FE] Always report UNINITIALIZED_ENUM_COMPANION_WARNING
^KT-54055
2022-09-16 07:12:19 +00:00
Dmitriy Novozhilov 3a5a6e5587 [FE] Add test for KT-54055 2022-09-16 07:12:19 +00:00
Dmitriy Novozhilov b86d5cf21a [FE] Postpone ProhibitAccessToEnumCompanionMembersInEnumConstructorCall till 1.9
^KT-49110
2022-09-16 07:12:19 +00:00
Sergey Bogolepov ddc2eb79c3 [K/N] Convert StubGenerator build script to Kotlin
Besides usual pros of kts, it simplifies potential reuse
of code from other build.gradle.kts (namely, Interop:Indexer).

Also, this commit fixes red code in IDE by adding proper dependencies.
2022-09-16 04:53:41 +00:00
Alexander Udalov 0569f429dd Report error on -Xuse-old-backend, remove Gradle option useOldBackend
Allow using old JVM backend only to compile kts.

 #KT-48532 Fixed
2022-09-16 00:16:31 +02:00
Alexander Udalov d50cf81e42 Remove tests on incremental compilation with old JVM backend
#KT-48532 Fixed
2022-09-16 00:16:31 +02:00
Alexander Udalov 97f63d539c Remove tests on jvm-abi-gen with old JVM backend
#KT-48532 Fixed
2022-09-16 00:16:31 +02:00
Vladimir Dolzhenko da86e536ad Do not swallow exception throwing IOOBE
#KTIJ-22746
2022-09-15 21:30:34 +00:00
Ilya Chernikov 0814c0da57 Fix lowering of receiver access in IR scripting
#KT-53947 fixed
without the fix, in the presence of the implicit receiver of the same
type as the processed receive, the lowering was incorrectly substituting
the correct receiver with the accessor to the implicit one
2022-09-15 22:05:00 +02:00
Jinseong Jeon 5721b3b73c AA: one representative lib module from compiler configuration
Split lib modules, which will be useful for reusable lib modules (if
there are multiple source modules that depend on same lib modules), are
not quite necessary for a project structure built from compiler
configuration. Those rather trigger OOM if lib modules' scopes are not
disjoint.
2022-09-15 21:27:13 +02:00
Jinseong Jeon e5b75dcd72 AA: cache PackagePartProvider per scope 2022-09-15 20:06:41 +02:00
Jinseong Jeon 2580a5c233 AA: migrate PackagePartProviderFactory to general API providers 2022-09-15 20:06:40 +02:00
Igor Yakovlev e2d758213f [WASM] Bump wasm gradle tests and ignore binaryen tests 2022-09-15 16:27:46 +00:00
Igor Yakovlev 38dd68f1f4 [WASM] Enable passing tests 2022-09-15 16:27:46 +00:00
Igor Yakovlev dbfd20ec4e [WASM] Add null-checks for external functions with String return type 2022-09-15 16:27:45 +00:00
Igor Yakovlev a7ed496a04 [WASM] Use wasm bottom types for Nothing? 2022-09-15 16:27:45 +00:00
Igor Yakovlev 3e6f153fe5 [WASM] Fix dce type removal for local variables 2022-09-15 16:27:44 +00:00
Igor Yakovlev 98f3c7c94e [WASM] Temporary disable stdlib tests 2022-09-15 16:27:44 +00:00
Igor Yakovlev 21328fea9d [WASM] Bump v8 version to 10.7.157 2022-09-15 16:27:43 +00:00
Igor Yakovlev c94a051c19 [WASM] Renew to Milestone 6 instructions set 2022-09-15 16:27:42 +00:00
Igor Yakovlev 780fdd44b3 Revert "[WASM] Remove deprecated usage of externref"
This reverts commit 270a41a2db.
2022-09-15 16:27:42 +00:00
Igor Yakovlev 61d6f69bca [WASM] Native support of returnable blocks 2022-09-15 16:27:41 +00:00
Igor Yakovlev 03c500d9e9 [WASM] Remove unreachable code from compiled wasm 2022-09-15 16:27:41 +00:00
Igor Yakovlev c2d4a2cfb5 [WASM] Small refactoring of box test runner 2022-09-15 16:27:40 +00:00
Igor Yakovlev 5169d96acd [WASM] Function call codegen refactoring 2022-09-15 16:27:40 +00:00
Igor Yakovlev 95396eb61a [WASM] When expressions optimisations for String and Int constant cases 2022-09-15 16:27:39 +00:00
Igor Yakovlev fff6b16483 [WASM] Wasm string.plus optimisations 2022-09-15 16:27:39 +00:00