Commit Graph

62746 Commits

Author SHA1 Message Date
Mikhail Zarechenskiy 8fdc39ecbc Update test data due to using stdlib with a pre_release flag
The problem here is that we have separate bootstrap compiler and
 artifacts (stdlib, for example) that are used in tests and implicitly
 participate in them.

 For example, this test started to fail when bootstrap compiler was
 advanced to a version where pre_release flag is enabled. As a result,
 dependent stdlib become pre_release as well and now we have additional
 error about `Unit` type
2020-03-10 17:22:26 +03:00
Ilya Goncharov ae6a603a92 [Gradle, JS] Fix for produceExecutable in Groovy build script 2020-03-10 17:01:40 +03:00
Dmitry Petrov 90d012cecb Handle unbound extension receiver in callable reference adaptation 2020-03-10 16:56:48 +03:00
Dmitry Petrov e175ff0d73 KT-36953 break/continue/return/throw have kotlinType Nothing 2020-03-10 16:56:48 +03:00
Mikhail Glukhikh 603685b5a4 Mute FIR2IR test (pushed as unmuted accidentally?) 2020-03-10 15:19:35 +03:00
Mikhail Glukhikh 2651fe9fb8 FIR2IR: use CLASS kind for anonymous objects 2020-03-10 15:19:35 +03:00
Mikhail Glukhikh 9c3dfed2d7 FIR2IR: provide IR_EXTERNAL_DECLARATION_STUB origin also for members 2020-03-10 15:19:35 +03:00
Mikhail Glukhikh e9699e7173 FIR2IR: provide correct origins for arithmetic operators 2020-03-10 15:19:35 +03:00
Mikhail Glukhikh 64e71e9d25 FIR2IR: use IR_EXTERNAL_DECLARATION_STUB for external classes 2020-03-10 15:19:34 +03:00
Mikhail Glukhikh ed6c9e67a1 FIR2IR: convert qualifiers to companion objects, if any 2020-03-10 15:19:34 +03:00
Mikhail Glukhikh 7ea4c20f3d [FIR TEST] Fix FIR_IDENTICAL adding for Fir2IrTextTestGenerated 2020-03-10 15:19:34 +03:00
Dmitriy Novozhilov dd7ac1343e [FIR] Unwrap when subject expression recursively in DFA variable storage
#KT-37327 Fixed
2020-03-10 15:05:05 +03:00
Alexander Udalov 676ffff015 Minor, fix builtinFunctionReferenceOwner.kt for android-tests
In codegen tests on Android, everything is being run with kotlin-reflect
in the classpath. So a package is no longer represented by a
reflect-less PackageReference, but by a full-blown KPackageImpl. Use a
less specific supertype ClassBasedDeclarationContainer instead, the one
which is a supertype of both PackageReference and KPackageImpl, and
which still allows to get the underlying jClass.
2020-03-10 12:59:54 +01:00
Alexander Udalov ac6be2edba Treat class files with no bytecode version as having the current version
This has no effect currently because all class files produced by Kotlin
have the bytecode version in the metadata (currently 1.0.3).

However, this change will allow us to stop writing bytecode version to
metadata in Kotlin 1.5. In fact, we could do it while the default here
was INVALID_VERSION too, but then for example compiling with Kotlin 1.3
against binaries of version 1.5 would lead to extraneous "incompatible
bytecode version" errors (because INVALID_VERSION is basically 0, which
is incompatible to 1.0.3+), in addition to the correct "incompatible
metadata version" error.

The reason why we might want to avoid writing bytecode version is the
fact that the initial use case it was added for is already supported by
the metadata version, and the bytecode version error reporting was never
fully implemented. Actually bytecode version was almost unused because
of that.
2020-03-10 12:07:39 +01:00
Alexander Udalov 787e4503e5 Migrate -Xuse-experimental -> -Xopt-in in project sources 2020-03-10 12:07:15 +01:00
Alexander Udalov d668808b44 Migrate Experimental->RequiresOptIn in project sources 2020-03-10 12:07:15 +01:00
Alexander Udalov 795d6ab407 Migrate UseExperimental->OptIn in project sources 2020-03-10 12:07:14 +01:00
Victor Petukhov 125b39d9be NI: Temporary apply test data until fix KT-37380 2020-03-10 13:25:11 +03:00
Toshiaki Kameyama 77f85d8b7c Move to top level: update import directives on the usage site when the declaration to be moved is not private
#KT-37213 Fixed
2020-03-10 10:28:23 +01:00
Alexander Gorshenev b06a3ea5ac Print out abi version as a full triple 2020-03-10 12:06:59 +03:00
Alexander Gorshenev a635748848 Provide library producer compiler version in klib abi mismatch disagnostics 2020-03-10 12:06:59 +03:00
Alexander Gorshenev fac71ac812 Be prepared if in the future we extend klib abi version to a triple 2020-03-10 12:06:59 +03:00
Leonid Startsev 5d73550b48 Do not check visibility of enum entries in explicit api mode
Although they're instances of DeclarationDescriptorWithVisibility,
they can't have visibilities

#KT-37040 Fixed
2020-03-10 11:55:59 +03:00
Nicolay Mitropolsky 753d4b3cbd Uast: UastFakeLightMethod equality fix (KT-37200) 2020-03-10 11:33:56 +03:00
Yan Zhulanow c1f89159d9 Pill: Add compiler.version module to Pill 2020-03-10 17:24:23 +09:00
Roman Artemev 7fff4e78e5 [KLIB] Do not include return type into mangle 2020-03-10 11:12:09 +03:00
Roman Artemev 62621de4fc [KLIB] Don't have a special mangle for internal declarations 2020-03-10 11:12:09 +03:00
Roman Artemev 7430bfe518 [KLIB] Update test data
- mute temporary broken test
 - add regression test
2020-03-10 11:12:08 +03:00
Roman Artemev 7034edac4c [JS IR] Move signature consistency checker into appropriate place 2020-03-10 11:12:08 +03:00
Vladimir Dolzhenko 3c26d38804 Revert Clear computable when value is calculated in LockBasedStorageManager
Relates to #KT-35256
2020-03-10 09:10:46 +01:00
Vladimir Dolzhenko ddba8e7691 Extend incremental analysis to object declaration
Fixed #KT-37250
2020-03-10 09:08:47 +01:00
Georgy Bronnikov ae208f58a4 Workaround for KT-37302 2020-03-10 10:58:36 +03:00
pyos 735fae0e5a JVM_IR: apply TailCallOptimizationLowering to all suspend functions
Even if a function is known to be tail call because it's a compiler
generated bridge, the tail return might still need to be added in case
of Unit return type.
2020-03-09 19:21:32 +01:00
pyos dc388f3f3a JVM_IR: add a test for suspend inline fun with defaults in a class
This is one example of a function replaced by a lowering after
AddContinuationLowering mentioned in the last commit: the lowering that
makes default stubs static is further down. Although this is not a
lambda, calling getOrCreateSuspendFunctionViewIfNeeded on it in the
inliner is fatal all the same.
2020-03-09 17:05:42 +01:00
pyos 862cd5665b JVM_IR: add continuations to inline suspend lambdas in the lowering
Delaying suspend view generation until the inliner is not a good idea
because it prevents lowerings after AddContinuationLowering from
further transforming the declarations.
2020-03-09 17:05:42 +01:00
pyos b393f2f680 JVM_IR: merge suspend view and suspend stub maps 2020-03-09 17:05:42 +01:00
Denis Zharkov 15a0157c42 FIR: Support proper loading of Map.merge 2020-03-09 12:56:02 +03:00
Denis Zharkov 4a1302e385 FIR: Add problematic test case
^KT-37318 Open
2020-03-09 12:56:02 +03:00
Denis Zharkov b2ff4d7f9a FIR: Support expansion of flexible type-alias-based types in inference 2020-03-09 12:56:02 +03:00
Denis Zharkov afb84b1d2a FIR: Support type aliased declarations in HtmlFirDump 2020-03-09 12:56:02 +03:00
Victor Petukhov 92a0ddfe71 NI: discard def not null types if they appear in return positions, in inv or in variance
^KT-37343 Fixed
2020-03-08 19:00:27 +03:00
Mark Punzalan 368b0d9b0b [JVM IR] Use reference equality when comparing enums. 2020-03-06 23:01:32 +01:00
Mark Punzalan a732e8f5fe [JVM IR] Ensure there is one accessor for each super access from a
subclass when there are multiple subclasses in a file.
2020-03-06 22:59:52 +01:00
Steven Schäfer 34fb636904 JVM: Generate generic signatures for delegate fields 2020-03-06 21:51:30 +01:00
pyos 20ea77d55d JVM_IR: refactor ToArrayLowering and make matching more precise
* If `toArray` is inherited from Java, it may take an argument or
    return a value of a flexible type, which looks nullable in IR;
  * The returned array may also have `out` variance of the type
    argument;
  * `Array<T>` is not the same as `Array<Any?>` if `T` is neither `Any`
    nor `in Something`, so presence of `toArray(): Array<T>` does not
    mean we don't need to generate a new `toArray`.
2020-03-06 18:33:25 +01:00
Alexander Udalov a2b6282d49 Refactor ApiVersion.KOTLIN_1_4 usages in relation to unified null checks 2020-03-06 16:55:55 +01:00
Alexander Udalov 98aecbef6b Optimize runtime representation for callable reference subclasses
Instead of generating overrides for getOwner/getName/getSignature in
each anonymous class representing a callable reference, pass them to the
superclass' constructor and store as fields. This occupies some small
memory but helps to reduce the size of the generated class files, and
will be helpful for adding further runtime information to callable
references, such as information about implicit conversions this
reference has been subject to.

Represent owner as java.lang.Class + boolean instead of
KDeclarationContainer, so that the unnecessary wrapping Class->KClass
wouldn't happen before it's needed, and also to make sure all callable
references remain serializable.

Note that the argument type where the "is declaration container a class"
is passed is int instead of boolean. The plan is to pass the
aforementioned implicit conversion information as bits of this same
integer value.

 #KT-27362 Fixed
2020-03-06 16:55:07 +01:00
Alexander Udalov 8d7c8672ac Generate reference to existing class for builtin function references
Instead of non-existing `kotlin.KotlinPackage`, which led to
NoClassDefFoundError as soon as reflection tried to call getOwner on a
builtin callable reference, use a reference to a new physical class
`kotlin.jvm.internal.Intrinsics$Kotlin`. This will allow to support
KT-17151.

Note that for API version less than 1.4, this will still lead to
NoClassDefFoundError, but this is not worse than the current situation
where it happens anyway.
2020-03-06 16:55:05 +01:00
simon.ogorodnik bfa371ea73 [FIR] Rewrite casts to reduce performance dispersion 2020-03-06 18:13:00 +03:00
simon.ogorodnik 426f498e87 [FIR] Forking runner for modularized test 2020-03-06 18:12:59 +03:00