Commit Graph

61181 Commits

Author SHA1 Message Date
Alexander Udalov f4912ed433 Minor, simplify JS-related build files a bit
* remove test roots in modules which have no tests
* 1.8 is already the default JVM target in the project
* replace compilation dependency on kotlin-reflect with runtime
2020-01-29 18:03:22 +01:00
Alexander Udalov d27bb76fd0 Remove dependency of serialization.js on cli
To break up compilation dependency of JS IR/WASM backends on JVM
backend.

 #KT-35854 Fixed
2020-01-29 18:03:22 +01:00
Alexander Udalov dcf6a2199a Generate JvmOverloads methods as final
#KT-33240 Fixed
2020-01-29 18:01:57 +01:00
Mads Ager 73aa36ca59 JVM: Add D8 check that class files can be dexed with D8.
This change adds D8 in addition to Dx which is being deprecated.
At some point after the official Dx deprecation, we should remove
the Dx checker.

Moving to D8 has the additional benefit that D8 can dex code
using java 8 features without using a separate desugaring tool.
2020-01-29 18:00:45 +01:00
Nicolay Mitropolsky 222ceb7698 Uast: fix for Lambda in place call identifiers (KT-35432) 2020-01-29 19:57:43 +03:00
Nicolay Mitropolsky ac3a8eb494 Uast: fixes for Enum identifiers (KT-35432) 2020-01-29 19:57:43 +03:00
Alexander Udalov 953b461c53 Add new compiler errors and flags when JVM compiles against JVM IR
From now on, the old JVM backend will report an error by default when
compiling against class files produced by the JVM IR backend. This is
needed because we're not yet sure that the ABI generated by JVM IR is
fully correct and do not want to land in a 2-dimensional compatibility
situation where we'll need to consider twice more scenarios when
introducing any breaking change in the language. This is generally OK
since the JVM IR backend is still going to be experimental in 1.4.

However, for purposes of users which _do_ need to compile something with
the old backend against JVM IR, we provide two new compiler flags:
* -Xallow-jvm-ir-dependencies -- allows to suppress the error when
  compiling with the old backend against JVM IR.
* -Xir-binary-with-stable-api -- allows to mark the generated binaries
  as stable, when compiling anything with JVM IR, so that dependent
  modules will compile even with the old backend automatically. In this
  case, the author usually does not care for the generated ABI, or s/he
  ensures that it's consistent with the one expected by the old compiler
  with some external tools.

Internally, this is implemented by storing two new flags in
kotlin.Metadata: one tells if the class file was compiled with the JVM
IR, and another tells if the class file is stable (in case it's compiled
with JVM IR). Implementation is similar to the diagnostic reported by
the pre-release dependency checker.
2020-01-29 17:20:41 +01:00
Kristoffer Andersen f262f61096 [JVM + IR] Fix Generic Signature Test Expectations 2020-01-29 17:14:41 +01:00
Mark Punzalan e226561150 [JVM IR] Copy metadata in IrFieldBuilder.
This fixes an issue with lateinit properties where the metadata from
the original field was not copied to the nullable field in
LateinitLowering. Also consolidated related tests.
2020-01-29 17:12:16 +01:00
Mikhael Bogdanov f5f25224b0 JVM_IR. Add IrAsmLikeInstructionListingTestGenerated tests 2020-01-29 17:00:00 +01:00
Mikhael Bogdanov 342ff50e31 Minor. Update test 2020-01-29 16:59:59 +01:00
Mikhael Bogdanov 1ecf9d407f JVM_IR. Align order of JvmOverload functions between backends 2020-01-29 16:59:58 +01:00
Mikhael Bogdanov 504d79577d JVM_IR. Align outer parameter name generation between backends 2020-01-29 16:59:57 +01:00
Mikhael Bogdanov 17e89fbbdb JVM_IR. Align synthetic parameter name generation across backends 2020-01-29 16:59:57 +01:00
Mikhael Bogdanov c42984ca33 Generate proper flags for <clinit> 2020-01-29 16:59:56 +01:00
Mikhael Bogdanov 6c07dbf351 JVM_IR. Support type annotations 2020-01-29 16:59:55 +01:00
Vyacheslav Gerasimov e4258e528f Introduce internal property sourceMapBaseDirs for Kotlin2JsCompile
Separate property needed to prevent Gradle snapshotting absolute paths
as inputs when passed as compiler argument.
To reduce property visibility to external users put it to the impl class
which will make it invisible in completion but still usable in Kotlin
build.
2020-01-29 18:15:31 +03:00
Abduqodiri Qurbonzoda b06645d1c0 Update number of reachable nodes because of MutableList.removeFirst/Last 2020-01-29 17:53:08 +03:00
Dmitriy Dolovov 9594b8db42 Rename Kotlin/Native modules for uniformity 2020-01-29 20:30:46 +07:00
Dmitriy Dolovov abd86107d1 Include :native:frontend.native into kotlin-compiler.jar 2020-01-29 20:30:40 +07:00
Dmitriy Dolovov 25ff33cc3c Update NativePlatformAnalyzerServices from Kotlin/Native repo 2020-01-29 20:30:35 +07:00
Dmitriy Dolovov b49e6ac581 Rename :kotlin-native:kotlin-native-library-reader to :native:frontend.native 2020-01-29 20:30:29 +07:00
Mikhail Glukhikh 53d50c935a [FIR] Do not use strict type equality in override checker 2020-01-29 15:58:12 +03:00
Mikhail Glukhikh e43a57bdee [FIR] Do not process constructors in super-type scopes 2020-01-29 15:58:04 +03:00
Mikhail Glukhikh b4267558d7 [FIR] Fix constructors aliased importing 2020-01-29 15:57:47 +03:00
Dmitry Petrov bf9673a0a2 PSI2IR: SAM conversion should be performed once for index variables
Given esoteric code as in 'caoWithAdaptationForSam.kt', we should make
sure that we pass same objects to 'get' and 'set'.
2020-01-29 15:30:07 +03:00
Mikhail Zarechenskiy e750528551 Fix project compilation against bootstrap compiler
This is needed after e3b6104489
2020-01-29 15:25:22 +03:00
Svyatoslav Kuzmich 091e8495cd [JS IR] Use util-klib tool to filter klib in JS IR gradle plugin 2020-01-29 15:22:07 +03:00
Stanislav Erokhin e3225469b5 Fix typo in Copyright since year 2020-01-29 15:01:23 +03:00
Toshiaki Kameyama ebe3619251 KT-33384 Intention to switch between single-line/multi-line lambda (#2790)
Add intention for single-line lambda <-> multi-line lambda conversion

#KT-33384 Fixed
2020-01-29 12:32:26 +03:00
David Schreiber-Ranner f94d026e64 Retrieve outputFile from KotlinWebpack task 2020-01-29 12:15:04 +03:00
David Schreiber-Ranner ae22dc352c Fix file components order
The path of the webpacked JavaScript file that should be included in the server JAR is constructed by taking the webpack tasks output directory, and appending the filename of the JavaScript module. Previously, the constructor arguments were flipped, leading to an invalid path.
2020-01-29 12:15:04 +03:00
Mikhail Zarechenskiy a8edd08121 [NI] Do not rely on a key that returns non-substituted types 2020-01-29 11:43:15 +03:00
Mikhail Zarechenskiy e42f16c95c [NI] Fix construction of common system for builder inference 2020-01-29 11:43:15 +03:00
Mikhail Zarechenskiy e3b6104489 [NI] Map vararg to Array if it's resolved against type variable
While this behavior is questionable, it's consistent with OI and can
 be changed in future

 #KT-36201 Fixed
2020-01-29 11:43:14 +03:00
Mikhail Zarechenskiy 35f6810b58 [NI] Do not incorporate constraints that are needed only for nullability 2020-01-29 11:43:13 +03:00
Mikhail Zarechenskiy ce690d8a1d Add test for obsolete issue
#KT-36121 Obsolete
2020-01-29 11:43:11 +03:00
Denis Zharkov e725f255f1 FIR: Share the same ScopeSession instance between phases
^KT-34563 Fixed
2020-01-29 11:31:57 +03:00
Denis Zharkov 280fb94774 FIR: Cache file importing scopes 2020-01-29 11:31:57 +03:00
Denis Zharkov 0b2b23189a FIR: Cache default importing scopes 2020-01-29 11:31:57 +03:00
Denis Zharkov 95084a5312 FIR: Minor. Inline unused parameter in FirDefaultStarImportingScope 2020-01-29 11:31:57 +03:00
Dmitriy Dolovov 3b33df6564 Reduce external dependencies in :kotlin-native:kotlin-native-library-reader 2020-01-29 15:29:49 +07:00
Dmitriy Dolovov 1b472b6b12 Move KonanLibraryConstants out of :kotlin-native:kotlin-native-library-reader 2020-01-29 15:29:42 +07:00
Dmitriy Dolovov cd71f250e5 Move KonanFactories out of :kotlin-native:kotlin-native-library-reader 2020-01-29 15:29:35 +07:00
Mikhail Glukhikh 3f95ac341c [FIR] Implement SAM candidates discrimination 2020-01-29 11:09:28 +03:00
Ilya Gorbunov c37a2d3dc3 Fix completion test: add coroutines-compat jar dependency
Related to KT-34582
2020-01-29 09:12:43 +03:00
Ilya Gorbunov 3bd3d61469 Test experimental coroutines version requirement on JVM only
Modify 'suspendFun' and 'nestedClassMembers' tests so that pre-release
suspend functions are tested only on JVM, where they are still supported.
2020-01-29 09:12:42 +03:00
Ilya Gorbunov 7792613f88 Finishing touch: drop experimental coroutines sourcesets from stdlib
#KT-36083
2020-01-29 09:12:42 +03:00
Ilya Gorbunov c28710419a Drop noStdLib coroutines tests
They were disabled anyway because coroutines can't be compiled without
the support API in stdlib

#KT-36083
2020-01-29 09:12:42 +03:00
Ilya Gorbunov 30bccc431b Migrate tests to release coroutines
where it's not essential to use experimental ones

#KT-36083
2020-01-29 09:12:41 +03:00