Commit Graph

65191 Commits

Author SHA1 Message Date
Denis Zharkov 2e91bf7e50 FIR: Minor. Clarify name for addNonLocalTowerDataElements 2020-05-15 16:04:44 +03:00
Denis Zharkov 288db4fb1c Revert "FIR: make both ImplicitReceiverStack.get implementations consistent"
This reverts commit b058ca635c.

Change is not necessary anymore since there are no kinds for implicit
receivers
2020-05-15 16:04:44 +03:00
Denis Zharkov 808355d817 FIR: Fix test data for secondary constructor delegation calls
They appeared, after the changes in previous commits at
org.jetbrains.kotlin.fir.resolve.transformers.body.resolve.FirExpressionsResolveTransformer#transformDelegatedConstructorCall

The idea is that dispatch receiver is available there in old FE, but additional
diagnostic should be reported on it (see KT-38813)

This change was not made intentionaly but it was the easiest way to
support new tower data elements structure and on the other side it's the
correct behavior as for old FE.

Also, if we once would prefer the previous behavior it's still not very
hard to support it
2020-05-15 16:04:44 +03:00
Denis Zharkov f71a56e742 FIR: Fix test data after rewritten scope structure
Mostly, the semantics for statics/companions has been changed there
Fixed test data now is much closer to semantics of old FE
2020-05-15 16:04:44 +03:00
Denis Zharkov f64c12efac FIR: Drop MutableImplicitReceiverStack and its implementation 2020-05-15 16:04:44 +03:00
Denis Zharkov 35e3942afb FIR: Drop unused ImplicitDispatchReceiverKind 2020-05-15 16:04:44 +03:00
Denis Zharkov 0ef1628751 FIR: Refactor scope structure on body resolve stage
Before this change:
- Local scopes, implicit receivers and type parameter scopes were separated.
- Static scopes for super classes were not present as a concept.
Instead of them, all-inherited-static for the current class has been used.
- During call resolution we were processing implicit receivers first and then non-local scopes,
while we should process them in the order of their syntax appearance from the closest
to the most distant

All these facts affect semantics (see test data changed here and the following commits)

The architecture changes are the following:
- FirTowerDataElement introduced as tower level that is used in resolution
  (effectively it's a union type between scope and implicit receiver + isLocal flag)
- FirTowerDataContext introduced for sake of encapsulation of tower data elements' list
  (it also has redundant implicitReceiverStack and localScopes)
- For each regular class we collect relevant tower data elements and add them to the current context
- Also, we preserve a special tower data context for static entities of the class
  (it doesn't have class' dispatch receiver and generic parameters)
2020-05-15 16:04:44 +03:00
Denis Zharkov cee38e0800 FIR: Implement FirScopeProvider.getStaticScope
It will be used in the following commits
2020-05-15 16:04:44 +03:00
Denis Zharkov 5268802d5d FIR: Minor. Move "storeFunction" call to transformSimpleFunction
It's only neede there and also scope structure will be cleaned up after transformFunctionWithGivenSignature
in the following commits
2020-05-15 16:04:44 +03:00
Denis Zharkov 3d6eedc962 FIR: Do not store nested local classes to local scopes 2020-05-15 16:04:44 +03:00
Denis Zharkov 07be2ae5c7 FIR: Use containers structure in FirContractResolveTransformer
transformDeclarationContent call remembers the container
2020-05-15 16:04:44 +03:00
Denis Zharkov a67e9966b8 FIR: Adapt DataFlowAnalyzer to PersistentReceiverStackImpl
It will be used as main implementation in further commits
2020-05-15 16:04:44 +03:00
Denis Zharkov 687a58843f FIR: Rewrite visibility checking
Unbound it from implicit receiver stack as it only needs scope structure/declaration nestedness
Semantics for protected has been changed in a way it works in old FE

NB: We should report additional diagnostic in case of CallCompanionProtectedNonStatic.fir.kt
(see KT-38814)
2020-05-15 16:04:44 +03:00
Denis Zharkov 825cdd3841 FIR: Move PersistentImplicitReceiverStack to resolve module 2020-05-15 16:04:44 +03:00
Denis Zharkov e8232fe471 FIR: Remove unused TowerGroupKind.Static 2020-05-15 16:04:44 +03:00
Denis Zharkov 56c793ffc6 FIR: Minor. Extract FirDeclarationsResolveTransformer::doTransformRegularClass
It's will be useful in the following commits
2020-05-15 16:04:44 +03:00
Denis Zharkov 7489b9f636 FIR: Minor. Inline processMembersForExplicitReceiver 2020-05-15 16:04:44 +03:00
Denis Zharkov fee639258c FIR: Simplify file imports scope tracking 2020-05-15 16:04:44 +03:00
Denis Zharkov 8a51bb7810 FIR: Minor. Unbound FirTowerResolverSession from FirLocalScope 2020-05-15 16:04:44 +03:00
Denis Zharkov 8363671cab FIR: Inline constructor parameter at FirTowerResolverSession 2020-05-15 16:04:44 +03:00
Denis Zharkov 75c4239504 Add "*.png binary" to .gitattributes 2020-05-15 16:04:44 +03:00
Toshiaki Kameyama 1d39ac1d3e Move statement: do not move when function last parameter is on same line as right parenthesis
#KT-14757 Fixed
2020-05-15 15:02:58 +02:00
Jinseong Jeon 615636ed55 FIR2IR: apply SAM conversion to arguments of functional type. 2020-05-15 15:08:43 +03:00
Vladimir Dolzhenko 599c5dd474 Collect unique subtypes from incremental compilation cache 2020-05-15 10:48:55 +00:00
Vladimir Dolzhenko 2f3ff10204 formatting clean up 2020-05-15 10:48:54 +00:00
simon.ogorodnik e101f88b50 [FIR] Add lines per second metric 2020-05-14 20:58:27 +03:00
Toshiaki Kameyama 8a595ad165 Move statement: Add or remove empty lines correctly
#KT-14946 Fixed
2020-05-14 18:57:56 +02:00
Victor Petukhov 73dec25eb1 NI: intersect DFI types before capturing
^KT-37887 Fixed
2020-05-14 19:54:59 +03:00
Toshiaki Kameyama 5a7ceec985 Color settings: use "Static field" instead of "Instance field" for "Enum entry" language defaults
#KT-15143 Fixed
2020-05-14 18:40:00 +02:00
Ilya Gorbunov 0e67e8e747 Advance bootstrap to 1.4.0-dev-8447 2020-05-14 19:35:00 +03:00
Roman Artemev 34bdd95e50 [JS SCRIPT] Enable js script test along with other script tests 2020-05-14 17:58:33 +03:00
Roman Artemev 9d9930f748 [JS SCRIPT] Fix test dependencies
- make sure kotlin stdlib is compiled and accessible
2020-05-14 17:58:33 +03:00
Roman Artemev 0e21dd15ba [JS SCRIPT] Fix script test data 2020-05-14 17:58:33 +03:00
Roman Artemev 31af1e6ca7 [JS SCRIPT] Fix ScriptDependencyCompiler
- Invoke KotlinIrLinker properly
2020-05-14 17:58:33 +03:00
Roman Artemev 52a93f189e [JS SCRIPT] Fix IrBuiltIns to make it stable if symbols already defined 2020-05-14 17:58:32 +03:00
Roman Artemev 8f71bdbf01 [JS SCRIPT] Fix IrScript visit order 2020-05-14 17:58:32 +03:00
Roman Artemev f792c5c936 [JS SCRIPT] Fix default arguments in script 2020-05-14 17:58:32 +03:00
Roman Artemev 996137576e [JS SCRIPT] Fix script lowering 2020-05-14 17:58:32 +03:00
Roman Artemev e573efb3a5 [JS SCRIPT] Handle IrScript in mangler correctly 2020-05-14 17:58:32 +03:00
Yaroslav Chernyshev 785fa7dd1c [Gradle, Import] Ignore incompatible test runs for Native targets.
#Fixed KT-34516
2020-05-14 17:43:00 +03:00
Nikolay Krasko e2857a910b Minor: show existing modules in absent error in gradle tests 2020-05-14 16:13:38 +03:00
Nikolay Krasko 189a9dbc02 201: Mute tests with changed module names after idea update (KT-37125)
Problems started with commit:
https://github.com/JetBrains/kotlin/commit/67fdc5db3bd91ee836843f95adcbaf2ddf53028b
2020-05-14 16:13:37 +03:00
Alexander Udalov 82551e91a4 Add KClass.isFun modifier to reflection
#KT-38881 Fixed
2020-05-14 14:05:51 +02:00
Anton Bannykh 86b5c63891 JS IR: fix origin for callable references with bound reciever
In case of IrFunctionReference with type SuspendFunction (no K!) there
was a misalignment between the base class (Any) and the
origin (LAMBDA..). As a result the SuspendFunctionLowering was
getting confused and produced hanging code.
2020-05-14 14:33:12 +03:00
Anton Bannykh bdca4b45bd JS: inliner supports extra argument caused by suspend conversions 2020-05-14 14:33:12 +03:00
Alexander Udalov ed8efafa9b Generate InnerClasses attribute for nested classes in annotation arguments
Otherwise we incorrectly try to load a nested class "A.B" as if it is a
top level class named "A$B" and fail.

 #KT-38853 Fixed
2020-05-14 13:20:13 +02:00
Mikhail Glukhikh cdac6157a9 [FIR2IR] Force loading Java SAM from external classes 2020-05-14 14:07:40 +03:00
Jinseong Jeon 89a6ecd77d [FIR] Update argument mapping while transforming integer operator. 2020-05-14 13:42:07 +03:00
Juan Chen 858731cac8 [FIR] add support for varargs in delegated constructor calls
Also add support for spread operators as named arguments.
2020-05-14 13:42:07 +03:00
Mikhail Glukhikh 3652ac9354 [FIR2IR] Mute 2 failing BB tests
Looks like both tests are failing because now only classes from
'kotlin.*' are considered "external" and generated with declarations.
2020-05-14 13:40:37 +03:00