Commit Graph

31580 Commits

Author SHA1 Message Date
Vladimir Ilmov 12ebd429bc Revert "Light classes support for declarations in multipart classes."
This reverts commit 3ea51a982c.
2020-09-09 19:46:03 +02:00
Ilmir Usmanov 0492a52a6a Minor. Regenerate tests 2020-09-09 17:43:43 +02:00
Ilmir Usmanov 52f9569d33 Generate CHECKCAST Object inside the markers
otherwise, the unboxing interferes with bytecode analysis.
2020-09-09 17:43:42 +02:00
Ilmir Usmanov e8a451072e Minor. Add tests with same JvmType in covariant override 2020-09-09 17:43:41 +02:00
Ilmir Usmanov 7cbd067460 Add tests with resume path 2020-09-09 17:43:39 +02:00
Ilmir Usmanov 1c97eafea8 Check for COROUTINE_SUSPENDED inside callable reference
#KT-41429 Fixed
2020-09-09 17:43:37 +02:00
Ilmir Usmanov 4303e8126f Do not generate suspend markers inside callable reference
#KT-41429
 #KT-25519 Fixed
2020-09-09 17:43:36 +02:00
Ilmir Usmanov ccc5b7afe0 Box inline class in resume path of suspend call
#KT-41429
2020-09-09 17:43:35 +02:00
Ilmir Usmanov 023cdd7cd4 Support not boxing inline class of reference class
even if the class is other than Any.
 #KT-41429 In progress
2020-09-09 17:43:34 +02:00
Alexander Udalov 3d7619421f JVM IR: fix exception on star projection in type parameter upper bound
#KT-41761 Fixed
2020-09-09 17:07:52 +02:00
Victor Petukhov 685d16ec68 NI: don't do substitution for unsupported callable descriptors to use as callable references
^KT-41729 Fixed
2020-09-09 18:00:41 +03:00
Vladimir Ilmov 3ea51a982c Light classes support for declarations in multipart classes.
relates to #KT-39196
2020-09-09 15:01:55 +02:00
Vladimir Ilmov a5d91339b5 (lightClass) multifile classes facade in libraries added
relates to #KT-39196
2020-09-09 15:01:54 +02:00
Victor Petukhov c1ebd33833 Capture flexible intersection types properly: take into account both bounds and use the same captured arguments for them
^KT-41693 Fixed
2020-09-09 14:52:12 +03:00
Dmitriy Novozhilov f748d8cf70 [FIR] Extract ResolutionContext to separate file 2020-09-09 12:38:36 +03:00
Dmitriy Novozhilov 1a84ec9677 [FIR] Mark all session components respectively to they have mutable state or not
Also add documentation for all fir annotations
2020-09-09 12:38:35 +03:00
Dmitriy Novozhilov 8686e3779e [FIR] Make all session components abstract classes 2020-09-09 12:38:35 +03:00
Dmitriy Novozhilov caf325934c [FIR] Unmake FirSamResolver as session component
It can not be stored in session because it depends on scope session
  and have mutable state
2020-09-09 12:38:35 +03:00
Dmitriy Novozhilov 29addd2a2b [FIR] Make InferenceComponents session component 2020-09-09 12:38:35 +03:00
Dmitriy Novozhilov 41b395b0aa [FIR] Extract mutable state from InferenceComponents 2020-09-09 12:38:35 +03:00
Dmitriy Novozhilov d70858edfa [FIR] Get rid of inference components in CheckerSink 2020-09-09 12:38:35 +03:00
Dmitriy Novozhilov 912676d868 [FIR] Introduce ResolutionContext and get rid of components in Candidate 2020-09-09 12:38:34 +03:00
Dmitriy Novozhilov c53ffca34f [FIR] Extract BodyResolveContext from FirAbstractBodyResolveTransformer 2020-09-09 12:38:34 +03:00
Dmitriy Novozhilov edb1273355 [FIR] Report ResolutionDiagnostics instead of applicability in resolve 2020-09-09 12:38:34 +03:00
Dmitriy Novozhilov a148db9d81 [FIR] Get rid of CandidateApplicability.SYNTHETIC_RESOLVED 2020-09-09 12:38:34 +03:00
Dmitriy Novozhilov 19707667fd [FIR] Cleanup detection that applicability is successful 2020-09-09 12:38:34 +03:00
Dmitriy Novozhilov 68f3d84e22 [FIR] Use CandidateApplicability from FE 1.0 2020-09-09 12:38:34 +03:00
Dmitriy Novozhilov cd557ad178 Change order of enum entries in CandidateApplicability 2020-09-09 12:38:34 +03:00
Dmitriy Novozhilov d1568c1ce6 Rename ResolutionCandidateApplicability to CandidateApplicability 2020-09-09 12:38:33 +03:00
Mikhail Glukhikh db2e3f219f [FIR] Keep bare type for type alias case 2020-09-09 12:16:09 +03:00
Alexander Udalov 3a5d0ab427 JVM IR: fix HashCode intrinsic for generics substituted with primitives
The problem here was that although the IR type of the expression was
primitive, the type of the actual expression in the bytecode generated
after type erasure was `Ljava/lang/Object;`, and we were trying to call
a non-existing method `Object.hashCode(Object)`.

 #KT-41669 Fixed
2020-09-08 23:37:00 +02:00
Alexander Udalov c46c80822c JVM IR: fix enclosing constructor for lambdas in inner classes
Before this change, we stored the enclosing constructor in a map in
JvmBackendContext before moving lambdas and local classes out of
initializer blocks. However, in case the lambda was declared in an inner
class, we stored a reference to the unlowered constructor of the inner
class, whose JVM signature is "()V" instead of the correct "(LOuter;)V".
Java reflection then threw exception if we tried to call
`getEnclosingConstructor()` on such class at runtime. Proguard finished
with errors for the same reason.

It turns out that we can just store the fact that the class has been
moved, and load the matching constructor in codegen, where everything is
already lowered and guaranteed to match with the signatures of the
actual generated declarations.

 #KT-41668 Fixed
2020-09-08 23:37:00 +02:00
Alexander Udalov 228e329d1f JVM IR: generate enclosing constructor only for lambdas in initializers
There was a typo in JvmLocalClassPopupLowering which allowed the
EnclosingMethod for lambdas and anonymous classes in initializers to
become any function in a class, in case when there was no primary
constructor in that class. E.g. in the added test, `getIrrelevantField`
was the EnclosingMethod of the lambda class before this change.
2020-09-08 23:37:00 +02:00
Alexander Udalov 7fb7dc0210 Fix deprecation warnings related to Project extensions 2020-09-08 20:26:20 +02:00
Mads Ager 06680452dc [JVM_IR] Always look for default lambdas in the inliner.
This allows compiler plugins such as Compose to do custom
default argument handling in methods that do not have origin
`FUNCTION_FOR_DEFAULT_PARAMETER`.

The code still bails out early is there is not defaults
mask, so there should be no compile-time penalty.
2020-09-08 19:07:31 +02:00
anastasiia.spaseeva a12e22bba4 [Spec tests] Fix dependencies for spec tests generator 2020-09-08 16:14:47 +03:00
Dmitriy Novozhilov 28a83b04cd [FIR] Minor. Fix code style 2020-09-08 12:51:13 +03:00
Dmitriy Novozhilov 67604dcb66 [FIR] Add generator for checkers aliases and sets of checkers 2020-09-08 12:51:12 +03:00
Dmitriy Novozhilov 4de57fcac2 [FIR] Initialize module for checkers generator 2020-09-08 12:51:12 +03:00
Dmitriy Novozhilov 6656669551 [FIR] Fix typo 2020-09-08 12:51:12 +03:00
Dmitriy Novozhilov 3b9e86ccbf [FIR] Remove empty file 2020-09-08 12:51:12 +03:00
Dmitriy Novozhilov a8a5ed3cd3 [FIR] Get rid of runCheck in checkers components 2020-09-08 12:51:11 +03:00
Dmitriy Novozhilov 71a855112e [FIR] Get rid of ParallelDiagnosticsCollector 2020-09-08 12:51:11 +03:00
Dmitry Petrov 6746bd81d5 PSI2IR tests for KT-41735 2020-09-08 12:34:19 +03:00
Steven Schäfer 44ffb1fb3e Psi2Ir: Fix SAM conversion with new inference 2020-09-08 11:14:14 +03:00
pyos 75891e860b FIR2IR: split getIrPropertyOrFieldSymbol, handle locals there 2020-09-08 08:40:13 +03:00
pyos f198a19ab0 FIR2IR: add local delegated property generation 2020-09-08 08:40:07 +03:00
Steven Schäfer 4792be2522 JVM IR: Optimize static property references (KT-36975) 2020-09-07 21:01:29 +02:00
Alexander Udalov 669fda6b77 Do not add duplicate $completion when compiling JVM against JVM_IR
This change fixes JvmOldAgainstIrBoxInlineTestGenerated.Suspend and
JvmIrAgainstOldBoxInlineTestGenerated.Suspend tests.
2020-09-07 19:41:38 +02:00
Alexander Udalov ae448ececb Minor, add compileKotlinAgainstKotlin test case for KT-41374 2020-09-07 19:41:37 +02:00