Commit Graph

367 Commits

Author SHA1 Message Date
Jinseong Jeon edc17a9d5f FIR LC: populate no-arg constructor if needed 2021-11-25 12:53:54 +01:00
Ivan Kochurkin f046f2964b [FIR] Add PLATFORM_CLASS_MAPPED_TO_KOTLIN 2021-11-24 23:13:41 +03:00
Ivan Kochurkin 51b73bb6ae [FIR] Add REDUNDANT_NULLABLE diagnostics 2021-11-24 23:13:40 +03:00
Ivan Kochurkin 4caf3c5e83 [FIR] Add NOT_A_CLASS diagnostics 2021-11-24 23:13:40 +03:00
Ivan Kochurkin 3beb447e85 [FIR] Consider anonymous object declarations in classDeclarationsStack in transformers 2021-11-24 23:13:38 +03:00
Nikolay Lunyak 8d647fa016 [FIR] KT-49265: Fix implicit visibility checks 2021-11-24 14:44:50 +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 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 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
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 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
Victor Petukhov a5c6d370dd [FE 1.0] Eliminate resolution ambiguity with external type parameters
^KT-10926 Fixed
2021-11-22 14:18:29 +03:00
Victor Petukhov 5c3835ab39 [FE 1.0] Don't use identifier in WhenMissingCase.kt if it wasn't provided
^KT-49702 Fixed
2021-11-22 10:44:06 +03:00
Victor Petukhov 42805db989 [FE 1.0] Take into account import aliases during hidden member resolution 2021-11-22 10:43:43 +03:00
Jinseong Jeon 3ccbd25856 FIR LC: populate inner classes in interfaces 2021-11-20 21:34:48 +01:00
Tianyu Geng d0d1c8c4b9 Analysis API: add test for getReturnExpressionTargetSymbol
Also fix FIR and FE1.0 implementations.
2021-11-19 23:29:17 +01:00
Ilya Chernikov cad57e693f FIR: introduce declaration origin for binary classes from source module
in particular for incremental compilation when module is only partially
recompiled.
#KT-49750 fixed
2021-11-19 08:36:15 +01:00
Jinseong Jeon 205866a516 FIR IDE: add API to get KtType from KtTypeParameter 2021-11-18 17:33:17 +01:00
Jinseong Jeon d91170ed2c FIR IDE: add more tests about resolving reference to type parameters 2021-11-18 17:33:17 +01:00
Dmitriy Novozhilov da02d25278 [FE 1.0] Implement deprecation warning for private constructors of sealed classes
^KT-44866
^KT-49729 Fixed
2021-11-18 13:54:05 +03:00
Dmitriy Novozhilov 93378b1a04 [FE 1.0] Resolve private constructors of sealed classes same as for regular classes
^KT-44866
^KT-49729
2021-11-18 13:54:05 +03:00
Ilya Kirillov 7f6afcabf1 Analysis API: regenerate tests 2021-11-17 20:55:11 +01:00
Ilya Kirillov 7cb1f19a79 Analysis API: move component test classes to corresponding dirs 2021-11-17 20:55:10 +01:00
Ilya Kirillov 6f6a33e852 Analysis API: move testdata to corresponding components folders 2021-11-17 20:55:08 +01:00
Jiaxiang Chen f8262a2549 implement KtSymbolWithTypeParameters interface for KtPropertySymbol 2021-11-17 18:22:34 +01:00
Ivan Kylchik c7435ba760 Replace all occurrences of WITH_RUNTIME with WITH_STDLIB
We are going to deprecate `WITH_RUNTIME` directive. The main reason
behind this change is that `WITH_STDLIB` directive better describes
its meaning, specifically it will add kotlin stdlib to test's classpath.
2021-11-17 15:26:38 +03:00
Ivan Kochurkin f05436b939 [FIR] Fix false positive case of CANNOT_CHECK_FOR_ERASED
Restore CANNOT_CHECK_FOR_ERASED as error
2021-11-16 18:15:49 +03:00
Dmitriy Novozhilov 2aa027639c [FIR] Fix access to fields from super class
^KT-49654 Fixed
2021-11-16 15:48:08 +03:00
Dmitriy Novozhilov 499b97d51e [FIR] Fix setting file in supertypes resolution
^KT-49652 Fixed
2021-11-16 15:48:06 +03:00
Nikolay Lunyak 2fb066e261 KT-47101: Fix companion supertypes 2021-11-15 13:22:38 +00:00
Roman Golyshev 13e27a3e06 [FIR IDE] Get rid of KtPossiblyMemberSymbol::dispatchType 2021-11-15 14:36:35 +03:00
Roman Golyshev 4e1e1570df [FIR IDE] Add getDispatchReceiverType function and use
This function is under a heavy deprecation and should not be used,
since it will most probably be removed in the future
2021-11-15 14:36:31 +03:00
Roman Golyshev 3091269035 [FIR IDE] Create generated members for data classes more accurately in FIR Light Classes
`equals`/`hashCode`/`toString` don't necessarily come from `Any` - they
might be overridden in the abstract class like this:

```kt
abstract class Base {
  // reinforces overriding in inheritors
  abstract override equals(a: Any?): Boolean

  // implementation will be replaced by the generated for data class
  override hashCode(): Int = 0

  // implementation is final, compiler will not replace it
  final override toString(): String = ""
}
```
2021-11-15 14:36:26 +03:00
Tianyu Geng 1c8d1fcdba FIR Tree: make FirDefaultPropertyAccessor propagate dispatchReceiverType
Custom property accessor has this property set and hence it make sense
for the default accessor to have it too. Also, FE1.0's counterpart
has this bit set and it's returned through the analysis API.
2021-11-15 11:10:46 +03:00
Ilmir Usmanov b7d88be41a Regenerate FIR diagnostics-related files 2021-11-13 12:38:49 +01:00
zhelenskiy c1dc1f7e33 Diagnostics renamed
Signed-off-by: zhelenskiy <zhelenskiy2000@yandex.ru>
2021-11-13 12:38:45 +01:00
Ilya Kirillov 540bbc6bef Analysis API: temporary update descriptors testdata 2021-11-12 23:19:41 +01:00
Ilya Kirillov 50f5a0559e Analysis API: regenerate tests 2021-11-12 22:09:00 +01:00