Commit Graph

77 Commits

Author SHA1 Message Date
Mikhail Glukhikh 5a9e8b3c0a FE: add tests for KT-53966 (positive/negative) 2023-02-08 17:40:20 +00:00
Mikhail Glukhikh aafde418cc K2: store imported static qualifiers in dispatch receiver field
This is a partial revert of commit 104fd4c1
#KT-55116 Fixed
2023-01-26 15:27:55 +00:00
Ilya Kirillov 1bbcae5ed2 [FIR] fix resolve contract violation from scopes
We cannot call lazy resolve to STATUS phase from scopes as scopes may be accessed on a STATUS phase or earlier

^KT-54890
^KTIJ-23587 fixed
2023-01-13 21:32:51 +00:00
Dmitriy Novozhilov b174bb8844 [FIR] Update testdata after introducing FirResolvedErrorReference 2022-12-15 12:12:19 +00:00
Steven Schäfer 6af616d3c3 FIR: make declarations marked with 'override' implicitly open
#KT-52236 Fixed
2022-12-14 21:46:41 +00:00
Ilya Kirillov 644d1bf0d0 [FIR] ignore tests which fail because of resolve contracts violation 2022-12-12 16:21:07 +00:00
Steven Schäfer a7ba081d22 FIR: Fix interface delegation ABI
- Unifies the name of the `$$delegate_<n>` field between K1 and K2.
- Make the `$$delegate_<n>` field private
2022-12-02 21:54:18 +00:00
Mikhail Glukhikh 4dc7b6dddc K2: fix/universalize logic to determine that member is from Java 2022-11-11 13:30:40 +00:00
Mikhail Glukhikh 62ba1277bb K2: don't duplicate custom annotations in types #KT-54275 Fixed 2022-10-10 06:20:39 +00:00
Mikhail Glukhikh d491eba629 K2: add reproducer for KT-54275 2022-10-10 06:20:39 +00:00
Mikhail Glukhikh 85965d74f6 K2: fix implicit body resolve in case delegated property is on the path
#KT-54212 Fixed
2022-09-29 10:55:14 +02:00
Mikhail Glukhikh 75a29434bd K2: add reproducer of KT-54212 2022-09-29 10:55:04 +02:00
Mikhail Glukhikh e36091b926 K2: introduce even more readable renderer for types in messages
#KT-53343 Fixed
2022-09-13 09:05:48 +00:00
Mikhail Glukhikh 3848be596e Add test for KT-53343 2022-09-13 09:05:48 +00:00
Mikhail Glukhikh b4a92e8a56 Undeprecate @BuilderInference annotation #KT-52400 Declined 2022-08-17 14:07:13 +00:00
Mikhail Glukhikh 7333589663 K1/K2: add Enum.entries unconditionally and filter them out in tower
Before this commit, we added Enum.entries only in case when
LanguageFeature.EnumEntries was ON (with an exception in K1/Java case).
In this commit we add Enum.entries unconditionally, and in case
the language feature is OFF we filter them out during tower resolve.
2022-08-12 09:35:27 +00:00
Mikhail Glukhikh 38f4a35be2 FIR: introduce flexible types pretty rendering for no arguments case
#KT-52020 Fixed
2022-06-29 16:50:05 +00:00
Victor Petukhov fa7809cd80 [FE] Remove BuilderInference annotation from tests 2022-06-21 15:01:56 +02:00
Mikhail Glukhikh 065e852199 FIR: support more precise diagnostics about parameter names
#KT-52762 Fixed
2022-06-20 11:28:55 +00:00
Mikhail Glukhikh 9fbafc3eb9 Add test for KT-52762 2022-06-20 11:28:55 +00:00
Denis.Zharkov f70ae2df3a FIR: Refine inference constraints when type variable in flexible position
That issue might be fixed via changing
TypeVariableMarker.shouldBeFlexible at ConeConstraintSystemUtilContext
but this and some other tricks have been added because of incorrect
handling of constraints where type variable has a flexible bound

^KT-51168 Fixed
2022-05-19 16:53:59 +00:00
Ilya Kirillov b5ad6f5db4 [analysis api] move analysis session classes to separate packages, use KtAnalysisApiInternals to mark internal API 2022-05-12 16:15:14 +02:00
Ivan Kochurkin c6f52893fb [FIR] Fix inconsistent RETURN_TYPE_MISMATCH and TYPE_MISMATCH reporting on functions and properties
^KT-51203 Fixed
2022-04-05 15:50:43 +00:00
Mikhail Glukhikh 70366c3bcb FIR: forbid java.lang.String deprecated constructors #KT-51364 Fixed 2022-03-21 13:58:13 +00:00
Mikhail Glukhikh 05d65275bf FIR u/s scope: choose most specific intersection member for override check
Before this commit we took just first intersection member for this check.
However it's quite bad, because we were dependent on supertype order.
Choosing the most specific member looks more consistent here.

#KT-50969 Fixed
2022-01-31 21:59:18 +03:00
Mikhail Glukhikh 1137e61fc8 FIR: add test for KT-50969 2022-01-31 21:59:15 +03:00
Mikhail Glukhikh 98cdc95cd0 FIR DFA: exit delegate expression only after accessor completion
This commit fixes DFA problem (see test) when we accidentally try
to merge incoming flows from member property (val ... by cached ...) and
the following function. While completing lambda of buildList { ... }
inside by cached we accidentally assume that delegate is already left
and add the lambda into exitsFromCompletedPostponedAnonymousFunction.
This commit fixes the problem by exiting delegate later, after completion.
2022-01-20 23:46:39 +03:00
Mikhail Glukhikh 1938438fa1 FIR: save/restore tower data contexts during resolve jumps
#KT-50278 Fixed
2021-12-21 10:45:36 +00:00
Mikhail Glukhikh 25f30cb3a9 FIR: add resolve test for potential local scope problems 2021-12-21 10:45:34 +00:00
Simon Ogorodnik b45b624945 FIR: Fix integrating DeclaredUpperBound positions in builder inference 2021-12-15 22:23:01 +03:00
Mikhail Glukhikh df50a8141f FirCallCompleter: unwrap definitely not-null type properly
#KT-50180 Fixed
2021-12-13 16:24:59 +03:00
Tianyu Geng 765cad8448 FIR checker: substitute type parameters in dispatch receiver type
Consider the following code:

```
fun test(a: List<String>) {
  a.first()
}
```

The dispatch receiver type of `first` in this case is `List<T>` before
this change. After this change, it's `List<String>`.

In addition, this change also replace the dispatch receiver type with
the more specific type if available. For example, consider the following

```
class MyList: ArrayList<String>()

fun test(a: MyList) {
  a.get(0)
}
```
The dispatch receiver type of `get` is `MyList`, instead of
`ArrayList<String>`. That is, a fake override is created in this case.
2021-09-17 01:59:06 +03:00
Mikhail Glukhikh 3febabe977 Use OPT_IN instead of EXPERIMENTAL in diagnostic names 2021-09-10 16:29:13 +03:00
Denis.Zharkov 112af9b145 FIR: Rework bare types support
^KT-48305 Fixed
2021-08-30 16:24:44 +03:00
Dmitriy Novozhilov 0924216ed2 [FIR] Distinguish stub types for builder inference and for subtyping
^KT-48110 Fixed
2021-08-26 10:08:52 +03:00
Mikhail Glukhikh 82f268d611 FIR: add EXPERIMENTAL_API_USAGE reporting 2021-07-23 23:58:55 +03:00
Dmitriy Novozhilov f400477c70 [FIR] Remove generic parameter from FirDeclaration 2021-06-29 21:03:30 +03:00
Igor Yakovlev 30c381f16d [FIR] Fix invalid CallableId for methods in anonymous objects 2021-06-28 17:21:42 +03:00
Ivan Kochurkin 66e2b44272 [FIR] Implement UPPER_BOUND_VIOLATED_IN_TYPEALIAS_EXPANSION diagnostics, fix handling of UPPER_BOUND_VIOLATED 2021-06-25 20:57:46 +03:00
Ilya Kirillov 72b8593240 FIR IDE: do not use IJ test infrastructure in frontend-api-fir tests 2021-06-20 22:07:31 +02:00
Igor Yakovlev ec80c21fd1 [FIR IDE] Fix lazy resolve for local declarations 2021-06-19 19:23:24 +02:00
Denis.Zharkov 592256976e FIR: Fix inference of builder-inference function from expect type
Previously, such calls were being completed with FULL mode and incorrect
INFERENCE_NO_INFORMATION_FOR_PARAMETER has been reported
2021-06-07 15:25:57 +03:00
Ivan Kochurkin c4c2fbb5a0 [FIR] Implement RECURSIVE_TYPEALIAS_EXPANSION, CYCLIC_INHERITANCE_HIERARCHY diagnostics, fix stackoverlow exception in case if typealias points to type with type arguments 2021-06-03 20:41:58 +03:00
Victor Petukhov 758eb8f851 Fix builder inference tests 2021-05-28 15:36:22 +03:00
Denis.Zharkov 829f80179c FIR: Update rendered tree in test data 2021-05-20 17:24:29 +03:00
Mikhail Glukhikh 05872fc6a8 Support captured types in ConeTypeCompatibilityChecker 2021-05-07 17:06:34 +03:00
Jinseong Jeon e2dc21da90 FIR checker: warn useless as and is 2021-05-05 18:20:51 +03:00
Ilya Kirillov 09a94f3200 FIR IDE: ignore non-passing tests in compiler based tests 2021-05-04 08:19:49 +02:00
Mikhail Glukhikh 43a2ad0467 FIR: don't flatten for loop blocks in raw FIR builder 2021-04-19 15:11:12 +03:00
Mikhail Glukhikh b58e5b182c FIR: add test fixing builder inference case 2021-04-13 21:36:38 +03:00