Commit Graph

30875 Commits

Author SHA1 Message Date
Alexander Udalov 241f82c70f IR: avoid storing unnecessary fields in IrPropertyImpl 2020-07-22 22:38:21 +02:00
Alexander Udalov 3f06f8a6ba IR: avoid storing unnecessary fields in IrFunctionImpl 2020-07-22 22:38:20 +02:00
Alexander Udalov 517c3e1020 IR: introduce IrFakeOverrideFunction, IrFakeOverrideProperty
Use them instead of the implementations. This will allow to refactor
creation to a factory and allow to use other implementations in the
future.
2020-07-22 22:38:20 +02:00
Alexander Udalov ca5eb40fa5 IR: minor, avoid usages of IrBlockBodyImpl/IrExpressionBodyImpl 2020-07-22 22:38:20 +02:00
Mark Punzalan 174576af61 ForLoopsLowering: Handle Sequence<*>.withIndex(). 2020-07-22 22:32:29 +02:00
Mark Punzalan 132960a695 ForLoopsLowering: Eliminate use of @ObsoleteDescriptorBasedAPI. 2020-07-22 22:32:29 +02:00
Mark Punzalan b1ce21bc55 ForLoopsLowering: Reduce unnecessary temporary variables for the
"checked step" (check for a positive step arg) and "negated step"
(negate the step arg when the nested step is negative).
2020-07-22 22:32:29 +02:00
Mark Punzalan 291d62f653 ForLoopsLowering: Move handlers to sub-package and separate files. 2020-07-22 22:32:29 +02:00
Dmitry Petrov 1272162a7f JVM_IR: generate "safe" names for functions in init blocks 2020-07-22 19:49:48 +03:00
Jinseong Jeon e1abaa9b51 FIR: special visibility handling for monitor{Enter|Exit} 2020-07-22 12:16:32 +03:00
Jinseong Jeon 85f692ab40 FIR2IR: use DescriptorWithContainerSource if container source is available
The use of DescriptorWithContainerSource is the key to trigger the
proper generation of stub facade class as parent.
2020-07-22 12:16:32 +03:00
Alexander Gorshenev c076d81f0c [IR FAKE OVERRIDES] Properly account for outer class type parameters 2020-07-22 12:02:51 +03:00
Pavel Kirpichenkov 1ef17c6f3a Drop isErrorTypeAllowed flag from type system context
The flag was used exclusively during calculation of common super type.
This change relies on assumption, that common super type is
NOT calculated in IR type system context.
2020-07-22 11:41:42 +03:00
Pavel Kirpichenkov 710659324c [NI] Fix common supertype of types with error supertypes
Enable check for error supertypes during CST calculation in classic type system context.
Cyclic upper bound + known type parameters of superclasses may create non-error types
with error supertypes. Such types don't have common constructors with other normal types
and cause assertion errors during intersection.

^KT-36951 Fixed
2020-07-22 11:41:42 +03:00
Denis Zharkov 41bd013796 Fix incorrect usages of @NotNull type parameters in project sources
^KT-36770 In progress
2020-07-22 10:16:14 +03:00
Denis Zharkov 037ff2fa52 Fix incorrect handling of @NotNull type parameters
^KT-36770 In progress
^KT-40114 Relates
^KT-28785 Relates
2020-07-22 10:16:14 +03:00
Denis Zharkov 240311d9c7 Minor. Reformat JavaNullabilityChecker 2020-07-22 10:16:14 +03:00
Dmitry Petrov d93885e71c Add tests for deprecated properties 2020-07-21 22:25:44 +03:00
Dmitry Petrov e84339a0d3 JVM_IR: fields for deprecated enum entries have ACC_DEPRECATED flag
'Deprecated' annotation can't be applied to field itself.
2020-07-21 22:25:44 +03:00
Roman Artemev edab3e3ba9 [PLUGIN API] Add referenceTypeAlias API to IrPluginContext
- attempt to fix KT-40193
2020-07-21 18:38:33 +03:00
Roman Artemev c4b4912a71 Revert "[PLUGIN API] Make referenceClass resolve type aliases too" 2020-07-21 18:38:32 +03:00
Anton Bannykh cb15570d75 [JS IR BE] Fix validation errors (duplicate nodes and incorrect parent) 2020-07-21 18:25:17 +03:00
Vyacheslav Gerasimov a4457ba7ac Build: Setup dependency on dist for :compiler:fir:analysis-tests:test 2020-07-21 17:24:59 +03:00
Roman Artemev d7a0dbfae8 [PLUGIN API] Make referenceClass resolve type aliases too
- fix KT-40193
2020-07-21 15:36:31 +03:00
Ivan Kylchik 8b9fb6a6cd [FIR] Remove FirOperatorCall node from fir tree 2020-07-21 13:54:19 +03:00
Ivan Kylchik 3c01a39846 [FIR] Update test data after introducing new fir nodes 2020-07-21 13:54:17 +03:00
Ivan Kylchik d77d733244 [FIR] Complement fir rendering with newly created nodes 2020-07-21 13:54:17 +03:00
Ivan Kylchik 9a119a6757 [FIR] Replace all necessary usages of operator call with new ones
#KT-38333 Fixed
2020-07-21 13:54:16 +03:00
Ivan Kylchik def47bdd9d [FIR] Add new equalityOperatorCall node in control flow graph 2020-07-21 13:54:15 +03:00
Ivan Kylchik d23e9940ec [FIR] Change fir builder to use newly created nodes 2020-07-21 13:54:15 +03:00
Ivan Kylchik 708c8b8ef3 [FIR] Create additional nodes to replace operator call in some places
1. FirAssignmentOperatorStatement - represent assignment operations
such as =, +=, -=, /=, %=
2. FirEqualityOperatorCall - represent boolean operations such as ==,
!=, ===, !==

#KT-38333 In Progress
2020-07-21 13:54:14 +03:00
Roman Artemev 8c4930da2e [KLIB] Drop API which is no longer used 2020-07-21 13:15:35 +03:00
Roman Artemev bb20e4759b [KLIB] Use queue to track classes required fake override resolve
- Avoid module visiting to prevent lazy bodies loading
2020-07-21 13:15:35 +03:00
vladislavf7@gmail.com 2b0639d4ad [FIR] Cleanup and refactoring for checkers 2020-07-21 12:13:10 +03:00
vladislavf7@gmail.com fb946a6a3f [FIR] Move extended checkers list 2020-07-21 12:13:10 +03:00
vladislavf7@gmail.com 751ed60e42 [FIR] Fix redundant visibility modifier checker 2020-07-21 12:13:10 +03:00
vladislavf7@gmail.com a8ff5d17dc [FIR] Fix redundant modality modifier checker
Fixed function FirDeclaration.hasBody() and some others improvement
2020-07-21 12:13:10 +03:00
vladislavf7@gmail.com a988234bbf [FIR] Fix redundant explicit type checker 2020-07-21 12:13:09 +03:00
Pavel Punegov eecb43d4c9 Ignore test in Native backend 2020-07-21 11:26:57 +03:00
Steven Schäfer d62a6a2631 JVM IR: Do not create accessors for enum entry constructors 2020-07-20 22:37:49 +02:00
Alexander Udalov 71730696b2 JVM IR: rename JvmDeclarationFactory -> JvmCachedDeclarations 2020-07-20 22:26:11 +02:00
Alexander Udalov c7f9dc1c40 IR: rename DeclarationFactory to InnerClassesSupport, move out of context
Methods of the common interface DeclarationFactory were only used in
lowerings in InnerClassesLowering, which were used in JVM and JS, not
Native. Therefore, it makes sense to have this as a separate interface
and pass its implementation to these lowerings directly, instead of
declaring it in the common context (which is not going to be implemented
in Native).
2020-07-20 22:26:11 +02:00
Alexander Udalov cf884fb048 IR: remove JVM-specific methods from DeclarationFactory 2020-07-20 22:26:11 +02:00
Alexander Udalov 6907decd99 Report file name on exception from ASM in BinaryJavaClass
This is useful to diagnose cases like KT-40339
2020-07-20 22:25:55 +02:00
Matthew Gharrity 221d49a995 Set wantsDiagnostics() in AbstractFilteringTrace
report() already delegates to the parentTrace, so
wantsDiagnostics() should delegate to it as well.
2020-07-20 21:12:25 +03:00
Dmitry Petrov 2e31f95554 Update testData 2020-07-20 20:04:32 +03:00
Dmitry Petrov 2b9606becf JVM_IR: field for suspend main parameter is synthetic 2020-07-20 20:04:31 +03:00
Dmitry Petrov 7be9b18ff4 JVM: field for suspend main parameter is synthetic 2020-07-20 20:04:31 +03:00
Dmitry Petrov 6bc44a366a JVM_IR: fields for suspend lambda parameters are synthetic 2020-07-20 20:04:31 +03:00
Dmitry Petrov bae6037f00 JVM: fields for suspend lambda parameters are synthetic 2020-07-20 20:04:31 +03:00