Commit Graph

3930 Commits

Author SHA1 Message Date
Alexander Udalov d0544a148a Minimize dependencies of ModuleMapping
Prepare it to be moved to metadata.jvm
2018-04-23 18:42:32 +02:00
Zalim Bashorov ab03ab84bb Regenerate tests 2018-04-19 13:17:27 +03:00
Ilya Gorbunov 20b2277951 Minor: fix docs of internal getProgressionLastElement 2018-04-19 05:40:55 +03:00
Alexey Sedunov c7e72af170 Override/Implement Members: Copy @Experimental-annotated annotations
#KT-22922 Fixed
2018-04-13 20:23:06 +03:00
Alexey Sedunov c1d8ba9c2b Parameter Info: Do not render nullability annotations
#KT-23408 Fixed
2018-04-13 20:23:06 +03:00
Dmitry Savvinov 934c56a4da Wire StorageManager into a ClassTypeConstructorImpl and ClassDescriptorImpl 2018-04-12 13:44:10 +03:00
Dmitry Savvinov d438988fc6 Fix javadoc for StorageManager.createLazyValueWithPostCompute 2018-04-11 16:03:19 +03:00
Ilmir Usmanov 2cfe387bab Move coroutines to kotlin.coroutines package: compiler
Generate continuation type as kotlin.coroutines.Continuaion. This code will
fail at runtime since there is no stdlib backing this change yet.
However, in order to generate compatible stdlib we need a compiler, which
generates continuation type as kotlin.coroutines.Continuation.
Thus, firstly we support the change in the compiler, make it bootstrap
compiler and only then change stdlib and tests accordingly.
 #KT-23362
2018-04-10 22:51:46 +03:00
Dmitry Savvinov 2d8e4e752c Fallback to Any type in case supertypes are empty
This can happen e.g. if all supertypes were on the cycle (A : B, B : A)
-- then SupertypesLoopChecker will cut all supertypes that are on cycle,
leaving set of supertypes empty.

Some clients in the compiler are not ready to work with empty list of
supertypes -- notably, CommonSupertypes.

^KT-23029 Fixed
2018-04-10 17:25:43 +03:00
Dmitry Savvinov d8b7de4f0e Add extra diagnostic information when no common supertypes are found
We're suspecting that the culprit of such errors is race condition on
'supertypes' in AbstractTypeConstructor, when it is created using
'LockBasedStorageManager.NO_LOCKS'
2018-04-10 10:47:22 +03:00
Dmitry Savvinov 9455f50e58 Minor: reformat AbstractTypeConstructor.kt 2018-04-10 10:47:22 +03:00
Ilmir Usmanov bd0ad26dcf Support local suspend functions
Treat them like lambdas. This means:
1) Like local suspend lambdas, which become "non-suspend" after creating
jvmSuspendView, they do this as well
2) They both are generated with the same codegen.
3) They are treated differently only on front-end side.
 #KT-20364: Fixed
2018-04-06 19:11:19 +03:00
Ilya Chernikov 00320bad8d Implement support for additional receivers in the backend 2018-04-04 16:23:56 +02:00
Alexander Udalov 828cc6dbf3 Add module-info.java for kotlin-reflect
The standard way of loading resources with built-ins metadata from the
current class loader no longer works in the modular mode on Java 9
because the current class loader is for module 'kotlin.reflect', but the
metadata is located in the module 'kotlin.stdlib'. On Java 9, we now use
the class loader of 'kotlin.stdlib' to load these resources.

 #KT-21266 Fixed
2018-04-03 21:24:03 +02:00
Mikhail Zarechenskiy 0632bbbed0 Nullability of intersection type should be determined by supertypes
Intersection types cannot be nullable as is because of special rules for subtyping
2018-03-30 14:51:07 +03:00
Natalia Selezneva 15914dac86 Add ScriptExpectedLocations annotation to script-runtime.
It describes where script file can be found.
2018-03-30 14:43:17 +03:00
Dmitry Jemerov 20cd193030 Delete remains of external annotations support from compiler 2018-03-29 09:45:07 +02:00
Alexander Udalov c3b6abfb1f Minor, add javadoc to KotlinBuiltIns.isBuiltIn 2018-03-28 19:48:50 +02:00
Alexander Udalov 13df75ef74 Minor, extract isInstanceType to protoTypeTableUtil 2018-03-26 17:21:08 +02:00
Alexander Udalov f7a3182982 Minor, add default value to contract expression flags 2018-03-26 17:21:07 +02:00
Alexey Tsvetkov 8a82c1618c Use Plugins DSL in Kotlin Gradle scripts
When plugins DSL is used, there is no need to
manually generate typesafe accessors for extensions and
conventions (by running `./gradlew kotlinDslAccessorsSnapshot`).
2018-03-26 16:09:29 +03:00
Dmitry Petrov eb5904ea8e Underlying constructor for type alias should always be substituted
Otherwise PSI2IR fails because of type mismatch.
2018-03-23 11:43:44 +03:00
Dmitry Petrov bfcf1584a2 Minor: reformat code 2018-03-23 11:43:44 +03:00
Nikolay Krasko 117890dba8 Fix generating cls stubs when is metadata using type tables (KT-23345)
Affected cases:
 - return type for suspend lambda
 - aliased type in type alias declaration
 - using type alias instead of aliased type in declarations

 #KT-23345 Fixed
2018-03-22 11:54:03 +03:00
Mikhail Zarechenskiy effdfe8ec0 Prohibit incorrect annotations with use-site targets more precisely
#KT-21696 Fixed

The problem is coming from the fact that `AnnotationTarget.VALUE_PARAMETER` is mapped to receiver parameter and to value parameter, but annotation with use-site target `receiver` can be used only on type reference of receiver parameter
2018-03-22 04:03:08 +03:00
Ilya Chernikov d6792f5f52 Implement support for additional compiler arguments for scripts in IDE
fixes #KT-19120
2018-03-19 11:45:10 +01:00
Natalia Selezneva dcea9d0cd5 Add FATAL severity to script dependencies resolve result 2018-03-17 00:23:57 +03:00
Yan Zhulanow e2ed77354f Pill: Update module structure, add missing modules metadata and metadata.jvm 2018-03-16 16:31:55 +03:00
Denis Zharkov c334f46825 Avoid retaining reference to ProtoBuf.Package in JvmPackagePartSource
Otherwise, 2e933a165a doesn't help
2018-03-15 18:59:44 +03:00
Denis Zharkov 4b78abaa7a Minor. Reformat JvmPackagePartSource 2018-03-15 18:59:44 +03:00
Jake Wharton b22f051edb Add support for nullability annotations in androidx package. 2018-03-15 10:34:33 +03:00
Zalim Bashorov 9970dd051f Fix copyright's start year in generated tests 2018-03-14 15:04:58 +03:00
Alexander Udalov e21c73229c Throw exceptions explicitly in protoTypeTableUtil
Previously, if both type and typeId messages were missing (for example,
ProtoBuf.Function.returnType/returnTypeId) because of some bug, the
behavior was unpredictable because a type with id 0 from the type table
would be returned, which could be a completely irrelevant type. This is
an incorrect situation and we should report a diagnostic instead.
Temporarily throw an exception instead, since this only affects how the
compiler works on bad metadata
2018-03-14 12:25:23 +01:00
Alexander Udalov 0a78fe8ae3 Move some serialization helpers to metadata/metadata.jvm 2018-03-14 12:25:22 +01:00
Alexander Udalov 043f4c3d01 Increase patch number of metadata versions
After adding inline classes in 915455ebe9
2018-03-14 12:25:19 +01:00
Alexander Udalov 407de206a3 Minor corrections in proto schemas, mostly in comments
Also set up code style for the protobuf plugin
2018-03-14 12:25:19 +01:00
Alexander Udalov 9d8d4b837b Minor, move JavaFlexibleTypeDeserializer.id to JvmProtoBufUtil
To be able to read platform types with metadata.jvm
2018-03-14 12:25:18 +01:00
Alexander Udalov 3f3e05a9d2 Move essential metadata-related classes to 'metadata' and 'metadata.jvm' 2018-03-14 12:25:16 +01:00
Alexander Udalov 88dea9aa70 Move NameResolver to module 'metadata' and J2K
Also move NameResolverImpl to 'metadata' and JvmNameResolver to
'metadata.jvm'
2018-03-14 12:25:16 +01:00
Alexander Udalov 0ba42850f9 Drop ClassData and PackageData, rename ClassDataWithSource -> ClassData
Use pairs in JvmProtoBufUtil for simplicity
2018-03-14 12:25:15 +01:00
Alexander Udalov 5ed5ac8291 Minor, use stdlib instead of ifEmpty 2018-03-14 12:25:14 +01:00
Alexander Udalov a5a69c5099 Remove dependency of ClassMapperLite on JavaToKotlinClassMap
There are two reasons for this. First, this class will be used in the
metadata reading library which should not have dependencies on lots of
compiler stuff JavaToKotlinClassMap depends on.

Second, it was easy to accidentally break the deserialization in old
compilers by adding another mapping to JavaToKotlinClassMap. This was
possible because ClassMapperLite is used to decide whether or not the
JVM signature is "trivial" and should be written to the metadata (at
JvmSerializerExtension.SignatureSerializer.requiresSignature). If the
signature is trivial but mentions a type added in JavaToKotlinClassMap
in the new compiler, the old compiler will not be able to load the
signature correctly. See the comment on ClassMapperLite for more
information
2018-03-14 12:25:14 +01:00
Alexander Udalov b07c6086cd Remove dependency of NameResolverImpl on FqName
Remove AbstractJsProtoComparisonTest.getProtoData in favor of
(apparently copy-pasted) IncrementalJsCache.getProtoData
2018-03-14 12:25:12 +01:00
Alexander Udalov 4f81e572c7 Make NameResolver.getName extension instead of member
To get rid of dependency of NameResolver on Name
2018-03-14 12:25:11 +01:00
Alexander Udalov e31f286444 Make NameResolver.getClassId extension instead of member
To get rid of dependency of NameResolver on ClassId
2018-03-14 12:25:11 +01:00
Alexander Udalov 27ad4f7d5d Move ProtoBuf classes to package org.jetbrains.kotlin.metadata 2018-03-14 12:25:10 +01:00
Alexander Udalov 575a388b11 Move core protobuf schemas to 'metadata' and 'metadata.jvm' 2018-03-14 12:25:09 +01:00
Alexander Udalov 368af867b8 Add modules metadata and metadata.jvm 2018-03-14 12:25:08 +01:00
Alexander Udalov 99964cd030 Move descriptor-related utilities from Flags to ProtoEnumFlags 2018-03-14 12:25:07 +01:00
Alexander Udalov ec67a878a0 Minor, rename Deserialization -> ProtoEnumFlags
Also fix warnings and remove unneeded JvmStatic
2018-03-14 12:25:06 +01:00