Commit Graph

4099 Commits

Author SHA1 Message Date
Alexander Udalov 51979b9ffa Convert FunctionBase to Kotlin, add type parameter to Lambda
This will make it possible to avoid raw types when inheriting from both
FunctionBase and Function<R>. This change adds a generic type parameter
to FunctionBase and Lambda which is not source-breaking under our policy
because both FunctionBase and Lambda are internal classes (located in
package kotlin.jvm.internal)
2018-08-30 14:52:33 +03:00
Ilya Gorbunov 07a0cb91d4 Introduce Char.MIN_VALUE and MAX_VALUE constants (KT-21763)
Add Char.MIN_VALUE and Char.MAX_VALUE implementations in primitive companion objects.
Update builtins test data and public API.

Co-authored-by: Oskar Drozda <themppsplx@gmail.com>
2018-08-30 14:51:14 +03:00
Ilya Gorbunov 5ee3cc59b3 Split summary from description in Char docs 2018-08-30 14:51:12 +03:00
Ilya Gorbunov 0c50014e7a Introduce SIZE_BYTES and SIZE_BITS constants for all integral types
#KT-8247 Fixed
2018-08-30 14:51:10 +03:00
Ilya Gorbunov 31d7aae98d Annotate companion object declaration with SinceKotlin
Move it to the end of the class declaration.
Update builtins testdata
2018-08-30 14:51:08 +03:00
Kerooker be2ba61f13 Removed Boolean from ClassMapperLite to avoid compiler confusion 2018-08-30 14:51:06 +03:00
Kerooker af5f78076c KT-7922 Added Boolean Companion Object 2018-08-30 14:51:04 +03:00
Ilya Gorbunov 0f5f90cf52 Advance project version to 1.3-SNAPSHOT
Set LATEST_STABLE language version and current version of stdlib to 1.3, set IS_PRE_RELEASE
Remove "EXPERIMENTAL" from 1.3 version description in tests and gradle options
2018-08-30 14:49:27 +03:00
Alexander Udalov 4219aff548 Refactor DescriptorRenderer's renderAccessors option
In some tests with txt (probably all except loadJava), property
accessors are not rendered at all, so a third option value (NONE) will
be useful to determine whether we need to render annotations on property
accessors as get/set/sparam-targeted annotations on the property
2018-08-27 23:37:06 +02:00
Alexander Udalov 896cf61443 Move JVM-specific annotation FQ names and utils to frontend.java 2018-08-27 23:37:06 +02:00
Alexander Udalov ab441dcd96 Drop PropertyDescriptorImpl.setType that takes KotlinType
Only use the other setType that takes an instance of
ReceiverParameterDescriptor. This will make sure that call sites can
use correct receiver annotations
2018-08-27 23:37:05 +02:00
Alexander Udalov 34c033bcaf Take ReceiverParameterDescriptor in FunctionDescriptorImpl.initialize
Instead of just KotlinType. This will allow to pass annotations on the
receiver at call sites
2018-08-27 23:37:04 +02:00
Alexander Udalov 872f6e2cea Minor, make AnnotatedImpl not abstract 2018-08-27 23:36:24 +02:00
Mikhail Zarechenskiy 3f79a752a5 Check for accessibility of unsigned types when using unsigned literals 2018-08-27 15:16:14 +03:00
Alexander Udalov afd53c9870 Revert metadata version reading advancement for JS/Common
This commit reverts 59e2101a25 partially,
leaving only the implementation of KT-25972 for JVM. The reason is that
we can't fully commit to stabilizing JS (and .kotlin_metadata) binary
metadata formats so much as to postpone any changes done to it for a
whole release year time. It's likely that we will need to update JS
metadata format incompatibly pretty soon, and with the scheme where we
can read the "current + 1" version, it'd require advancing the metadata
version by 2, which would break the nice property that the metadata
version (since Kotlin 1.4) is equal to the version of the compiler that
produced it.

See KT-25972
2018-08-27 13:14:09 +02:00
Alexander Udalov a9a8925409 Revert "Report error on .class files produced by Kotlin 1.3-M1"
This reverts commit ba111d58ae.

The reverted commit only makes sense after a bootstrap step after
advancing the metadata version, which has not yet happened in master,
but did happen in 1.3-M2, where this commit was supposed to end up
2018-08-24 22:38:59 +02:00
Alexander Udalov ba111d58ae Report error on .class files produced by Kotlin 1.3-M1
Advance incremental cache version to force rebuild after switching from
1.3-M1 to 1.3-M2
2018-08-24 18:49:55 +02:00
Alexander Udalov 9c68f2be36 Advance metadata versions and JVM bytecode version
JVM versions are increased in order to differentiate pre-1.3-M2 .class
files where signatures mentioning inline classes were not mangled. Other
versions are increased in case something similar will need to be
detected
2018-08-24 13:01:53 +02:00
Ilmir Usmanov 483094cac8 Minor. Streamline SuspendFunction{N} interfaces creation 2018-08-22 16:21:33 +03:00
Ilmir Usmanov 0559cfb724 Move SuspendFunction{N} interfaces to kotlin.coroutines package
#KT-25824: Fixed
2018-08-22 16:21:30 +03:00
Alexander Udalov 59e2101a25 Support reading binary metadata of the next major release
Already existing tests testRequireKotlinInNestedClassesAgainst14{,Js}
now check that there's no error when loading a module/class with
metadata version 1.4.0

 #KT-25972 Fixed
2018-08-21 17:12:02 +02:00
Alexander Udalov 852760b3b0 Report error on incompatible .kotlin_module files in classpath
Also remove obsolete test wrongAbiVersionNoErrors

 #KT-25973 Fixed
 #KT-26266 Open
2018-08-21 17:12:02 +02:00
Denis Zharkov 944b0d058a Allow calling some pieces of the experimental coroutine API
- Calling suspend functions is allowed
- Presence of suspend function type still makes declaration
unusable unless it belongs to a value parameter as a top-level type
containing less then three parameters

Still, warning should be emitted because they will become unsupported in 1.4

 #KT-25683 In Progress
2018-08-21 13:44:02 +03:00
Dmitry Petrov 5045fa446a Prohibit recursive inline classes 2018-08-20 10:08:10 +03:00
Alexander Udalov 92e7fe347a Minor, provide more info when deserializing bad constant value 2018-08-17 16:31:54 +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 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
Dmitry Petrov 8e95ecb821 Use underlying type when computing type mapping mode for inline classes 2018-08-15 15:37:46 +03:00
Alexander Udalov ac0f5548aa Only check language version in MemberDeserializer.loadAsSuspend
This is still not 100% foolproof because one may place such a
requirement manually on a suspend function (with `@RequireKotlin`, for
example), which will trick the compiler into thinking that this is a new
suspend function, even if it was compiled with old coroutines. But it's
still better than only checking the version number
2018-08-13 11:02:36 +02:00
Alexander Udalov c011bf61fe Support multiple version requirements on single element 2018-08-13 11:02:35 +02:00
Denis Vnukov 65c79ecfe9 Primitive support for LocalVariables for function parameters 2018-08-09 16:13:21 +03:00
Mikhael Bogdanov 6b5b9fbde4 Temporary use special container mapping logic for IR backend 2018-08-09 14:22:47 +03:00
Mikhail Zarechenskiy 70aa16f71a Fix hashCode & equals for IntegerValueTypeConstant 2018-08-09 09:49:21 +03:00
Mikhail Zarechenskiy be38263fc7 Introduce conversions from signed pure constants to unsigned ones
#KT-24717 In Progress
 #KT-25996 Open
 #KT-25997 Open
2018-08-09 09:47:48 +03:00
Denis Zharkov 8050869e45 Use THashSet for sets that are assumed to be big
Otherwise, a lot of memory is wasted on nodes instances

(cherry picked from commit 4922f87)
2018-08-08 15:17:25 +07:00
Denis Zharkov 2fd9b3ee35 Do not initialize SimpleFunctionDescriptorImpl::userDataMap if it's empty 2018-08-08 15:17:25 +07:00
Alexander Udalov 5da8ce844a Minor, move ContentRoot and KotlinSourceRoot to module 'cli'
Also move CONTENT_ROOTS from JVMConfigurationKeys to
CLIConfigurationKeys since it's used on all platforms, not just JVM
2018-08-07 13:38:30 +02:00
Alexander Udalov 6f9441d3f4 Do not output empty non-root packages in tests with txt
Mostly to avoid listing every internal package in
kotlin-stdlib/kotlin-reflect, as in
https://github.com/JetBrains/kotlin/blob/acd5b62148d797ffd24c4811d1d663f0c1ae7885/compiler/testData/diagnostics/testsWithUnsignedTypes/conversions/conversionOfSignedToUnsigned.txt#L144
2018-08-06 13:43:32 +02:00
Mikhail Zarechenskiy 043ce1cb27 Support secondary constructors for inline classes
#KT-25614 Fixed
 #KT-25246 Fixed

 KT-25599 Will be fixed after recompilation of unsigned classes
2018-08-06 10:55:57 +03:00
Nikolay Krasko 653d1d00de Option for rendering types with enhancement 2018-08-03 16:00:07 +03:00
Nikolay Krasko ceeeffd814 Extend list of annotations ignored in parameter info (KT-24911, KT-25622)
#KT-24911 Fixed
2018-08-03 16:00:04 +03:00
Ilya Gorbunov 2a598e0ac4 Replace ReadOnly/Mutable usages in the compiler
Replace ones from org.jetbrains.kotlin package with new annotations from kotlin.annotations.jvm.
No need to copy them to compile kotlin-reflect anymore.
Then simplify reflect project more: no sources — no need to pack its direct output.
2018-08-03 09:37:38 +03:00
Zalim Bashorov 3c0d0d2ab4 [JS IR BE] Move external declarations to a separate IrPackageFragment to not generate code for them 2018-07-31 11:28:38 +03:00
Mikhail Zarechenskiy acd5b62148 Introduce limited constant conversions for Kotlin/Native
#KT-25320 Fixed
2018-07-29 04:32:32 +03:00
Ilmir Usmanov a10bd9f5a3 Refactoring. Move transformRuntimeFunctionTypeToSuspendFunction to TypeDeserializer 2018-07-25 15:35:13 +03:00
Ilmir Usmanov 533dd44668 Refactoring. Make DeserializedMemberDescriptor somewhat immutable 2018-07-25 15:35:09 +03:00
Alexander Udalov 31c968123c Regenerate tests 2018-07-25 11:30:57 +02:00