Commit Graph

2952 Commits

Author SHA1 Message Date
Georgy Bronnikov 58a9c0c996 JVM_IR: remove descriptor usage from IrTypeMapper 2020-06-13 12:44:59 +03:00
Igor Chevdar 8b37a094fe Added a test on possible name clash for SAM wrappers 2020-06-11 23:00:36 +05:00
Denis Zharkov 72b09ff323 FIR: Rename FirSuperTypeScope and reuse it for type parameter type
It would allow ConeKotlinType.scope return FirTypeScope
and thus pulling down org.jetbrains.kotlin.fir.scopes.FirScope#processOverriddenFunctions
(See the following commits)
2020-06-11 11:31:31 +03:00
Denis Zharkov 38922a84f1 FIR: Do not create synthetic properties for non-Java accessors
^KT-35495 Fixed
2020-06-11 11:01:43 +03:00
Jinseong Jeon ab2a2b3a87 FIR2IR: eager conversion of annotations in Library class and members 2020-06-11 10:57:51 +03:00
Ilmir Usmanov 85e2392fef Fix merging two reference values
In this case, make the result of value type Object instead of unknown.
2020-06-09 20:52:29 +02:00
Ilmir Usmanov 5567033b33 Revert "Revert "Completely rewrite reifiedIntTypeAnalysis, making it more streamline""
This reverts commit 822c14814b.
2020-06-09 20:52:24 +02:00
Alexander Udalov e801fad4d4 Minor, unmute test on fun interface inheritance for FIR 2020-06-09 20:00:37 +02:00
Alexander Udalov 6adad1055b JVM IR: generate delegates to DefaultImpls for fun interfaces 2020-06-09 11:49:45 +02:00
Alexander Udalov fc1217ba07 Generate delegates to DefaultImpls in fun interface wrappers
#KT-37436 Fixed
2020-06-09 11:44:31 +02:00
Alexander Udalov 2793187bda Handle IllegalArgumentException in trimMargin intrinsics on JVM
#KT-38537 Fixed
2020-06-09 11:11:06 +02:00
Mikhail Glukhikh 6f0eeecc64 [FIR2IR] Fix generation of type arguments of delegated constructor calls 2020-06-09 11:40:26 +03:00
Mikhail Glukhikh b2c78e490e [FIR2IR] Remove some descriptor-around calls 2020-06-09 11:40:25 +03:00
Mikhail Glukhikh 89e5e10657 [FIR2IR] Drop effectively unused FirMetadataSource.File.descriptors
NB: only FileClassLowering uses this property to check
whether facade is required, and IR-based check is enough in this lowering
2020-06-08 16:19:37 +03:00
Jinseong Jeon ba1172b3ad FIR2IR: distinguish substitution case when adding external fake overrides 2020-06-08 12:11:34 +03:00
Mikhail Glukhikh 3567880303 [FIR] Consider enum entry nested classes as local 2020-06-08 12:11:33 +03:00
Jinseong Jeon 0d2552b0b6 FIR: record and serialize the modifier "fun" for functional interface 2020-06-08 09:42:32 +03:00
Anton Bannykh bd2a0563ad JS: fix explicit cross-module SAM constructor calls 2020-06-06 13:20:37 +03:00
Ilmir Usmanov f0006f2405 Minor. Add regression test
#KT-39374 Fixed
2020-06-05 21:30:24 +02:00
Jinseong Jeon 89c87f941f FIR: consider the absence of type arguments when constructing GetClassCall type 2020-06-05 17:00:17 +03:00
Mikhail Zarechenskiy 718f23b34f Compatibility warning for references to companion via name (KT-13934) 2020-06-05 13:24:18 +03:00
Ilmir Usmanov 8cc5f2abfb Forbid val field initialization inside EXACLTY_ONCE lambda
unless the lambda is inline. This way, final field will remain final.
2020-06-04 21:26:48 +02:00
Mikhail Glukhikh 6ad37eb7a8 Unmute two more FIR BB tests 2020-06-04 17:26:27 +03:00
Mark Punzalan 802beb49a6 Use TypeSubstitutor to get the substituted underlying type for inline
classes, instead of MemberScope.

The primary motivation was to fix issues around type-mapping for inline
classes in FIR, which uses wrapped descriptors that have empty
MemberScopes.
2020-06-04 17:03:55 +03:00
Mikhail Glukhikh 0ce47f2f12 [FIR TEST] Mute 2 BB tests broken by 0d6e3093 2020-06-04 16:34:39 +03:00
Dmitry Petrov 202bbdf8dd Forward compatibility hacks for Result.{success, failure}
Don't mangled functions annotated with @JvmName.
Annotate 'Result.success' and 'Result.failure' with @JvmName and
@Suppress("INAPPLICABLE_JVM_NAME").
NB this would require bootstrap.
2020-06-04 12:16:27 +03:00
Jinseong Jeon 0d6e309372 FIR: construct type with actual type arguments during GetClassCall transformation 2020-06-04 10:13:37 +03:00
Dmitry Petrov a4b9e8fdc6 Minor: mute test in JS_IR 2020-06-03 23:24:16 +03:00
Ilmir Usmanov 822c14814b Revert "Completely rewrite reifiedIntTypeAnalysis, making it more streamline"
This reverts commit 1ed4324613.

Otherwise, bootstrap is broken.
2020-06-03 19:43:59 +02:00
Ilmir Usmanov 1ed4324613 Completely rewrite reifiedIntTypeAnalysis, making it more streamline
and easy to understand and optimize if it would be a bottleneck.
Use LVT to get information of refined int type in one specific case

 #KT-38925 Fixed
2020-06-03 16:03:50 +02:00
Dmitry Petrov 99a1ef0460 Minor: mute test in JS_IR 2020-06-03 16:09:52 +03:00
Svyatoslav Kuzmich e9e850ad8f [JS IR] Fix findInterfaceImplementation
isOrOverridesSynthesized uses descriptors which does not work with
wrapped descriptors
2020-06-03 10:47:15 +03:00
Denis Zharkov 409e90e7de FIR: Fix codegen test data after safe-call refactoring
^KT-38444 In Progress
2020-06-03 10:43:37 +03:00
Dmitry Petrov 5efbe6ae15 PSI2IR: SAM conversion in varargs 2020-06-02 23:53:47 +03:00
Dmitry Petrov 16f175612e KT-31908 Handle SAM conversion on vararg elements 2020-06-02 23:53:47 +03:00
Igor Chevdar e41b5fc1c6 [IR] Turned on a test for K/N + minor refactoring
NothingValueException has already been supported in K/N
2020-06-02 14:50:17 +05:00
Jinseong Jeon 6eb21031b2 FIR JVM serializer: serialize property signature 2020-06-02 12:00:52 +03:00
Abduqodiri Qurbonzoda 55eb75d237 Remove IGNORE_BACKEND directives from forInCharSeqWithIndexStops.kt 2020-06-01 22:00:37 +03:00
Juan Chen bfac0355bf WIP: [FIR] unmute testKt14227 with FULL_JDK
The test used to fail because it has an augmented assignment for
elements in a HashMap of Strings, and "plus" fails to resolve due to
ambiguity: besides String.plus, BigDecimal.plus in the standard
library is also considered. BigDecimal is not resolved and thus
isError returns true. During type checking, the context has
isErrorTypeEqualsAnything set to true, and BigDecimal is now regarded
as a super type of String and BigDecimal.plus is a valid
candidate. Adding the directive "FULL_JDK" enables resolving of
BigDecimal so that BigDecimal.plus is excluded.
2020-06-01 16:47:15 +03:00
Jinseong Jeon 4a511c7721 FIR: extend arrayOf call transformation to other variants 2020-06-01 10:45:42 +03:00
simon.ogorodnik 99b2a4745a [FIR2IR] Fix superQualifier in case of composed super type ref 2020-05-29 21:10:56 +03:00
simon.ogorodnik 8afbb4542b [FIR2IR] Fix check if interface is SAM 2020-05-29 21:10:56 +03:00
Alexander Udalov 7d9fe55072 Regenerate tests 2020-05-29 15:15:43 +02:00
Ilmir Usmanov 5f3e296f19 Fix bugs with capturing rhs into EXACTLY_ONCE lambda
There are multiple ways to declare a named variable-like entity in
Kotlin:
1. val/var variable declaration
2. destructuring declaration
3. parameter of a function
4. parameter of a lambda
5. destructured lambda parameter
6. for-loop's variable declaration
7. catch block exception declaration
8. val in when
9. field declaration

Out of them, only variable and field can be assignable, in other words,
they can be on the left hand side of an assignment.
Val/var variable declarations were already supported.
So, we needed to just support field initialization and tell the backend
that other ways are prohibited. Function and lambda parameters were
already been supported. So, the only thing to explain to the backend are
remaining ways.
 #KT-39113 Fixed
 #KT-34048 Fixed
2020-05-29 09:55:04 +02:00
Dmitriy Novozhilov a604404bff [NI] Report warning if candidate was chosen using only @OverloadResolutionByLambdaReturnType 2020-05-29 09:36:33 +03:00
Dmitry Petrov a270ee094c Language feature for new inline class mangling rules (since 1.4) 2020-05-29 00:53:01 +03:00
Mikhail Glukhikh b6cdcc8d50 [FIR2IR] Mute 2 failing BB tests 2020-05-28 22:51:20 +03:00
Mikhail Glukhikh 19f1a3de1a [FIR2IR] Populate overridden symbols also with public symbol inheritors 2020-05-28 22:19:21 +03:00
Mikhail Glukhikh 85760770a8 [FIR2IR] Initialize built-in symbols at start of conversion 2020-05-28 22:18:20 +03:00
Mikhail Glukhikh cd24745f1f [FIR2IR] Add primitive signature composer & use it for external classes 2020-05-28 22:18:13 +03:00