Commit Graph

87667 Commits

Author SHA1 Message Date
Dmitriy Novozhilov 6b330fb5d5 [FIR] Set proper return type for LighterASTNode.getChildren utility 2021-11-23 15:01:32 +03:00
Dmitriy Novozhilov 8cdddbfd9d [FIR] Implement checkers for FIR parcelize plugin
There is one of checks left unimplemented (FirParcelizePropertyChecker.checkParcelableClassProperty)
  because it requires huge commonization of detecting which type can be
  serialized and which not, which is not prioritized job for now
2021-11-23 15:01:31 +03:00
Dmitriy Novozhilov eac9a9fc79 [FIR] Implement FIR version of parcelize plugin
This commit includes only generation of declarations and
  ir backend part, checkers are added in separate commit
2021-11-23 15:01:29 +03:00
Dmitriy Novozhilov cb0705ec03 [FIR] Change scheme of generating declarations by plugins
Methods `needToGenerateAdditionalMembersInClass` and
  `needToGenerateNestedClassifiersInClass` are removed, now compiler
  uses `get...Names` and `getTopLevel...` methods to determine which
  extension may generate declaration with specific classId/callableId

This is needed to simplify API of FirDeclarationGenerationExtension and
  provide guarantee that `generate...` method will be called with
  specific classId/callableId only if specific extensions returned name
  for this id from `getName...` functions
2021-11-23 15:01:28 +03:00
Dmitriy Novozhilov 40d8451698 Add compiler diagnostic tests for parcelize checkers 2021-11-23 15:01:26 +03:00
Dmitriy Novozhilov b84ee64994 Move parcelize checkers testdata to :parcelize-compiler module 2021-11-23 15:01:23 +03:00
Dmitriy Novozhilov a093052b77 Delete sources of parcelize IDE plugin
They are moved to intellij community repo, so those sources in kotlin
  repository are actually redundant
2021-11-23 15:01:22 +03:00
Dmitriy Novozhilov b0f38bd996 [FIR] Save mapping from supertype to delegated field in class attribute
This is needed to let checkers know which specific interface was
  implemented by delegation
2021-11-23 15:01:21 +03:00
Dmitriy Novozhilov e25fff701b [FIR] Add FirClassLikeDeclarationChecker alias
Such checkers may be useful for checkers which are interested in all
  inheritors of FirClassLikeDeclaration
2021-11-23 15:01:21 +03:00
Dmitriy Novozhilov 33f78e3903 [FIR2IR] Fix collecting declarations for Fir2IrLazyClass
Existed code might lose declarations in two cases:
1. When there is a declared function which is mapped to property
    (java synthetic properties)
2. When class has property and function with same name
2021-11-23 15:01:20 +03:00
Dmitriy Novozhilov 307fa66dda [FIR] Resolve imports before plugin annotation phase
This is needed to correctly resolve imported annotations from plugins
2021-11-23 15:01:18 +03:00
Dmitriy Novozhilov 9948ba57c0 [FIR] Add ability to generate companion object from compiler plugin 2021-11-23 15:01:15 +03:00
Dmitriy Novozhilov 75ed11a620 [FIR] Remove few unused utils 2021-11-23 15:01:10 +03:00
Dmitriy Novozhilov 75b6f7ca00 [FIR] Make FirRegularClass.companionObject companionObjectSymbol field
This is needed for two reasons:
1. Before this change companion object appeared in FirRegularClass
  twice: in declarations list and in companionObject field. This may
  trigger twice transform of it
2. It's very hard to implement generation of companion object by plugins
  because if it is part of the tree then generated declaration must be
  registered in FirProvider, which is inconsistent with other generated
  declarations. Replacing FIR with symbol and removing custom logic of
  visiting/transforming companion FIR allows us to just replace companionSymbol
  in FirClass if plugin wants to generate it without any additional work
2021-11-23 15:01:05 +03:00
Ilya Goncharov 01deac5e5c [Gradle, JS]Run kotlinNodeJsSetup ad kotlinYarnSetup instead of assemble 2021-11-23 11:41:20 +00:00
Ilya Goncharov e32a1ca562 [Gradle, JS] Not resolve configuration with nodejs and yarn if it should not be downloaded 2021-11-23 11:41:19 +00:00
Svyatoslav Scherbina 5020d5f2f9 Native: make SymbolName internal
See ^KT-46649
2021-11-23 08:09:44 +00:00
Svyatoslav Scherbina 8bd1d7b2be Native: allow jsinterop and cinterop (legacy sourcecode mode) using SymbolName
The interop Kotlin source generators still use `@SymbolName` to link
Kotlin code with platform code.
2021-11-23 08:09:44 +00:00
Svyatoslav Scherbina d70eacb1b2 Native: remove the opt-in for SymbolName from stdlib
This annotation is no longer used there.
2021-11-23 08:09:43 +00:00
Svyatoslav Scherbina 6e0a152f39 Revert "[K/N] Replace SymbolName with GCUnsafeCall in interop"
This reverts commit ca9ec76c08.
2021-11-23 08:09:43 +00:00
Svyatoslav Scherbina 7042d01271 Revert "[K/N] Emmit error on using @SymbolName with new mm"
This reverts commit 7e58660ce2.
2021-11-23 08:09:42 +00:00
Dmitry Petrov 2179987de7 FIR2IR fix enum special methods generation 2021-11-23 06:34:33 +00:00
Dmitry Petrov 2a263eca65 FIR2IR strip annotations from IrConst type 2021-11-23 06:34:03 +00:00
Alexander Udalov 0048540652 Prepare kotlinx-metadata-jvm 0.4.0 for release 2021-11-23 02:17:01 +01:00
Ilya Kirillov 1335a2c3ab Analysis API: remove KtTypeRendererOptions.renderTypeArguments as unused 2021-11-22 22:47:20 +01:00
Ilya Kirillov 1d1f5ace8f Analysis API: rename KtCallableSymbol.type -> returnType 2021-11-22 22:47:01 +01:00
Ilya Kirillov 9d6da14847 Add run configurations for running Analysis API Tests 2021-11-22 22:47:01 +01:00
Ilya Kirillov d0318f1026 Analysis API: add test for file annotations 2021-11-22 22:47:00 +01:00
Ilya Kirillov e440c229f6 Analysis API: improve annotations value rendering in DebugSymbolRenderer 2021-11-22 22:47:00 +01:00
Ilya Kirillov ba918d45a2 Analysis API: introduce KtInitializerValue for initializer of KtPropertySymbol 2021-11-22 22:46:59 +01:00
Ilya Kirillov 02adb1924b Analysis API: add tests to check annotations on declarations 2021-11-22 22:46:58 +01:00
Ilya Kirillov fff8eb244c Analysis API: add annotations to KtTypeAliasSymbol 2021-11-22 22:46:57 +01:00
Ilya Kirillov 22cbcfb3c4 Analysis API: do not require tests to call super.doTestByFileStructure 2021-11-22 22:46:57 +01:00
Ilya Kirillov a084ad59de Analysis API: add test for annotations on types 2021-11-22 22:46:56 +01:00
Ilya Kirillov 193df3e3c4 Analysis API: fix annotation rendering for types 2021-11-22 22:46:55 +01:00
Ilya Kirillov 3a5e503f29 Analysis API: add KDocs to annotation related stuff 2021-11-22 22:46:55 +01:00
Ilya Kirillov bdde70312d Analysis API: update testdata after removing KtTypeAndAnnotations 2021-11-22 22:46:54 +01:00
Ilya Kirillov a5a5ff39d6 Analysis API: get rid of KtTypeAndAnnotations & add annotations for every type 2021-11-22 22:46:53 +01:00
Ivan Kylchik 83d2d2cfcf [JS TESTS] Disable node js runner for IR 2021-11-22 21:06:42 +03:00
Ivan Kylchik 3aa88a6ebe [JS TESTS] Allow saving artifacts into build directory on teamcity
This is required to properly run node js tests.
2021-11-22 21:06:40 +03:00
Dmitriy Novozhilov 9c7058c3c5 [FIR] Support fields as part of graph of class initialization
^KT-49747 Fixed
2021-11-22 20:22:22 +03:00
Dmitriy Novozhilov 5778cb440f [FIR] Add FirControlFloGraph owner supertype to FirField
FirField, just like FirProperty, can have control flow graph of it's
  intializer
2021-11-22 20:22:19 +03:00
Roman Artemev 3bef04cf5e Fix test and unmute it for JVM 2021-11-22 19:00:43 +03:00
Victor Petukhov d48557ed53 [FE 1.0] Fix containing KtFile check in NewResolutionOldInference.kt 2021-11-22 17:01:49 +03:00
Dmitriy Novozhilov 9807c67ae4 [FIR] Properly collect overriddens for method enhancement
If some java class has multiple supertypes then we need to collect
  overriddens from all those types directly, even if superTypeScope
  (which is FirTypeIntersectionScope in this case) returns only
  one symbol from one of this types (not intersection one)

This is needed to proper enhancement in cases when some type occurs
  multiple times in supertypes graph with different nullability
  of arguments:

class ConcurrentHashMap<K, V> : AbstractMap<K!, V!>, MutableMap<K, V>

If we try to find method `get(key: K): V` supertype scope returns
  `AbstractMap.get(key: K!): V!` (because it actually overrides
  `MutableMap(key: K): V?`), but we need to get both symbols to
  properly enhance types for `ConcurrentHashMap.remove`
2021-11-22 17:01:17 +03:00
Dmitriy Novozhilov 01c0cf80d0 [FIR] Support @kotlin.jvm.PurelyImplements annotation 2021-11-22 17:01:17 +03:00
Dmitriy Novozhilov 339c69fef0 [FIR] Collect all supertypes with same type constructor in corresponding supertypes cache
This is needed to fir behavior of cache with algorithm in
  abstract type checker
2021-11-22 17:01:17 +03:00
Dmitriy Novozhilov d72fcc92fe [FIR] Add utility function for collecting overridden tree for debug purposes 2021-11-22 17:01:16 +03:00
Dmitriy Novozhilov 6edf191b7f [FIR] Save classId in declared and use site scopes
This is needed for debug purposes, because without classId or reference
  to class it's very hard to understand which scope you are observing
  in debugger
2021-11-22 17:01:16 +03:00
Viacheslav Kormushkin a695d9bf59 KT-49771 - podInstall task is not executed after adding a pod dependency to the shared module
#KT-49771
2021-11-22 13:19:03 +00:00