Commit Graph

67671 Commits

Author SHA1 Message Date
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
Ilya Gorbunov 95cc35f22e Package builtins with jvm reflect into IDEA plugin only
Leave builtins with common reflect for stand-alone compiler.
2020-07-22 11:08:14 +03:00
Stanislav Erokhin 0c094b1719 Serialize jvm reflect into builtIns
Basically this is revert of 427e34fe5a commit
This was done due to the KT-39728.
Also we do pick every file separately, because builtIn serializer
unable to filter expects
2020-07-22 11:08:14 +03:00
Stanislav Erokhin 67090e1afb Move KTypeProjection to separate file 2020-07-22 11:08:14 +03:00
Zalim Bashorov ee26fd4959 [KJS FE] Change severity of NON_EXPORTABLE_TYPE from error to warning
The change is required to avoid breaking examples using kotlin-wrappers
until we find an acceptable solution for them.

#KT-39873 Fixed
2020-07-22 10:51:41 +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 f1c68a9080 Introduce JavaTypeEnhancement component
It's necessary to allow using language version settings in type enancement
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 d36d62e226 Add info about -Pteamcity to readme and make warning less annoying 2020-07-21 18:05:21 +03:00
Vyacheslav Gerasimov a4457ba7ac Build: Setup dependency on dist for :compiler:fir:analysis-tests:test 2020-07-21 17:24:59 +03:00
Vyacheslav Gerasimov 58ee95c8a3 Build: Add root IDE test tasks to split tests in 3 parts 2020-07-21 17:24:59 +03:00
Vyacheslav Gerasimov 036c359993 Build: Make local profile warning more visible 2020-07-21 17:24:58 +03:00
Vyacheslav Gerasimov d9fbaadb2e Build: Upgrade Gradle Enterprise plugin to 3.3.4 2020-07-21 17:24:58 +03:00
Roman Artemev d7a0dbfae8 [PLUGIN API] Make referenceClass resolve type aliases too
- fix KT-40193
2020-07-21 15:36:31 +03:00
Leonid Startsev a0154b9851 Add JarUtil.getJarAttribute to proguard rules
This method is used by serialization plugin to read runtime JAR
manifest.

Maven serialization plugin seems to use proguarded compiler
distribution,
so to use this method, it should be kept.

Size increased for about 2kb.
2020-07-21 15:10:08 +03:00
Leonid Startsev e3f42721e9 Mute/ignore 'PROVIDED_RUNTIME_TOO_LOW' in tests 2020-07-21 15:10:08 +03:00
Leonid Startsev df5f38fec8 Implement reading kx.serialization runtime metadata from jar manifest
That allows to check whether current compiler plugin can work with
a given runtime version. Implementation-Version can help to detect whether
runtime version is too low, and Require-Kotlin-Version detects whether
runtime version is too high.

Corresponding diagnostic for Require-Kotlin included.
Implement minimal runtime version check for kotlinx.serialization
plugin.

 #KT-40036 Fixed

Cache result from getVersionsForCurrentModule in BindingTrace.
Hide check in the IDE, because caching in trace does not work there.
2020-07-21 15:10:08 +03:00
Leonid Startsev 7db0bf8195 Add new serialization runtime packages
encoding and descriptors. Rename ContextSerializer to Contextual.
Unify getClassFrom*Package functions.
2020-07-21 15:02:06 +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
Ilya Gorbunov bace1b8055 Increase stdlib-js mocha test timeouts to 10s
Some tests often do not fit into the default timeout when running tests
in parallel on CI.
2020-07-21 05:43:38 +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