Commit Graph

93 Commits

Author SHA1 Message Date
simon.ogorodnik a8cd8ad8f8 [FIR] Fix testData after changing anonymous object name 2020-06-19 01:52:02 +03:00
Dmitriy Novozhilov d7ee168dff [FIR] Create error candidate for completion instead of simple error reference 2020-06-15 15:32:25 +03:00
Denis Zharkov 72b09ff323 FIR: Rename FirSuperTypeScope and reuse it for type parameter type
It would allow ConeKotlinType.scope return FirTypeScope
and thus pulling down org.jetbrains.kotlin.fir.scopes.FirScope#processOverriddenFunctions
(See the following commits)
2020-06-11 11:31:31 +03:00
Denis Zharkov 19219c37b6 FIR: Fix test data for KT-13650 related test
Now, the behavior seems to be more correct then in FE 1.0
2020-06-03 10:43:37 +03:00
anastasiia.spaseeva 6c1efbe812 [Spec tests] Update spec testData 2020-05-28 14:23:11 +03:00
Yan Zhulanow ef698a5747 Fix "PSI/index mismatch" in case of @ParameterName on non-functional types (KT-34524) 2020-05-27 02:38:41 +09:00
anastasiia.spaseeva 9d862aaa1d [Spec tests] Remove spec info from fir tests 2020-05-26 17:27:06 +03:00
Pavel Kirpichenkov 003ba1c8f5 [NI] CST: add preemptive recursion detection
For single super type constructor create star projection argument when types for that argument are equal to the original types.
Captured star projections are replaced with their corresponding supertypes during this check.
Skip check for `in` parameters, for which recursive cst calculation does not happen.
Adjust constant in fallback recursion condition.

^KT-38544 Fixed
2020-05-12 11:13:43 +03:00
Mikhail Glukhikh 52abc2ae1a [FIR] Fix spec test data according to a new diagnostic 2020-05-07 12:10:56 +03:00
Pavel Kirpichenkov 86d6470ced Update test data forgotten in 36a57973
KT-38544
2020-04-28 20:26:11 +03:00
Pavel Kirpichenkov 36a57973b5 [NI] CST: remove max depth offset from recursion detection
Recursive type with several recursive anscestors can create a number of identical
common supertype calculations, growing exponentially on every step of recursion.
Previously the number of calculations was limited by D + 3, where D is a type depth.
Since the limit is dynamic, it seems that extra +3 offset can be dropped thus
reducing the number of recursions. The proper solution is to detect such a recursion
and fold recursive type preemtively, but for now this may improve performance in some use cases.

^KT-38544 In progress
2020-04-28 12:53:09 +03:00
Denis Zharkov 3bb6aa6f28 Mark as FIR_IDENTICAL passing spec tests 2020-04-21 10:16:42 +03:00
Denis Zharkov 82b2825b7a FIR: Ignore flaky spec tests
^KT-38340 Submitted
2020-04-21 10:16:41 +03:00
Denis Zharkov b375e021e5 FIR: Ignore failing spec test
^KT-38397
2020-04-21 10:16:40 +03:00
Denis Zharkov 2ced716268 FIR: Adjust testData for spec tests: controversial infix calls
^KT-37374 Please, take a look at these tests
2020-04-21 09:52:52 +03:00
Denis Zharkov 76bb45b46f FIR: Adjust testData for spec tests: other small things 2020-04-21 09:52:52 +03:00
Denis Zharkov 2f0f552880 FIR: Adjust testData for spec tests: annotations 2020-04-21 09:52:52 +03:00
Denis Zharkov 0d34299b7a FIR: Adjust testData for spec tests: dfa 2020-04-21 09:52:52 +03:00
Denis Zharkov 86e1aadd31 FIR: Adjust testData for spec tests: contracts 2020-04-21 09:52:52 +03:00
anastasiia.spaseeva 4301744d2d [Spec tests] Add test for infix fun + KT-36786 2020-03-30 11:15:54 +03:00
Mikhail Zarechenskiy 191fb02bf6 [NI] Consider intersection type with number type as Nothing
Currently, only for "in": In<in Int & A> == In<in Nothing> == In<*>

 #KT-37302 Fixed
2020-03-23 16:39:21 +03:00
Mikhail Zarechenskiy 83824d0ba6 [NI] Don't stop on a candidate with unstable smartcast error
#KT-36847 Fixed
2020-02-20 12:34:34 +03:00
Victor Petukhov 51edf2b351 NI: introduce warning about implicitly inferred Nothing with existing non-Nothing expected type
^KT-35406 Fixed
2020-02-17 19:43:05 +03:00
Pavel Kirpichenkov b161839092 [NI] Report unsafe implicit invoke accordingly to OI
This reverts commit df046683cc.
KT-30695
2020-02-14 18:06:34 +03:00
Ilya Chernikov 6356807997 Reapply "Only create descriptors for candidates with lambda args"
#KT-36247 fixed
A lot of testdata changed because significanly less (error) descriptors
are created for unresolved types, so diagnostics became different.
2020-02-14 11:41:30 +01:00
Pavel Kirpichenkov e40ba73950 [NI] Add resolution applicability for resolved candidates with error
New resolution applicability is needed in cases when error is found,
but candidate still should be selected. Currently there are two cases,
when this behaviour is required:
- unstable smartcast (choose candidate with non-nullable parameter)
- unknown lambda parameter type (against non-functional expected type)

KT-36264
2020-02-13 18:02:37 +03:00
Pavel Kirpichenkov df046683cc Revert "[NI] Report unsafe implicit invoke accordingly to OI"
This reverts commit b045adf83a.
2020-02-13 16:06:40 +03:00
Mikhail Zarechenskiy ee48580e06 [NI] Update test data 2020-02-13 15:01:39 +03:00
Pavel Kirpichenkov b045adf83a [NI] Report unsafe implicit invoke accordingly to OI
There are several issues with unsafe desugaring for convention calls.
Proper fix is not implemented here (see design proposal KT-30872).
This commit only applies the old logic in the new inference.
^KT-30695 Fixed
2020-02-13 14:49:43 +03:00
Pavel Kirpichenkov 572dee6835 Revert "Only create descriptors for candidates with lambda args"
This reverts commits:
349d07ad43
2249c223fe

Revert due to differences in test data with NI enabled
^KT-36247 Open
2020-02-12 20:52:30 +03:00
Mikhail Zarechenskiy 759127df9a Add NI diagnostics for spec tests 2020-02-12 10:37:35 +03:00
Ilya Chernikov 2249c223fe Only create descriptors for candidates with lambda args
#KT-36247 fixed
2020-02-10 14:21:02 +01:00
Pavel Kirpichenkov 06550a6d31 [NI] Actualize spec tests, affected by KT-35668
Update test data, remove obsolete 'UNEXPECTED BEHAVIOUR'
2020-01-23 19:12:02 +03:00
Dmitriy Novozhilov 76b3964e96 Update testdata according to change compiler version to 1.4 2020-01-17 10:33:50 +03:00
Pavel Kirpichenkov 4d11fac365 [NI] Add restored smart casts to spec tests
KT-35668 Fixed
2020-01-15 14:39:40 +03:00
Denis Zharkov d6b01f1007 NI: In subtyping do not intersect arguments for non-covariant types
It partially reverts 7898922066
because it's not obvious that it's a safe operation
for invariant/contravariant types.

Also, there's a necessary fix in prepareReceiverRegardingCaptureTypes
to make types order stable
Otherwise test bareTypesWithStarProjections becomes flaky.

Also, the changes in bareTypesWithStarProjections.kt are also expected
because the type of the expression `coneSymbol` after the second "if" is
FirVariableSymbol<*> & FirPropertySymbol & AbstractFirBasedSymbol<*>
thus we fix D in the call `coneSymbol.phasedFir()` to FirVariableSymbol<*>
because it's the first type in the list
(see the next line after the last changed in AbstractTypeChecker)
2020-01-14 17:35:24 +03:00
Pavel Kirpichenkov 2d21b82501 [NI] Remove hack for special functions
Treating special functions for `if`, `when`, `try`, `?:` as not accepting `Nothing` result type is incorrect.
Making so leads to cases with uninferred `Nothing` result type for inner calls and lost data flow info.
2019-12-27 18:40:42 +03:00
Dmitriy Novozhilov d210df9ea3 Update spec testdata according to previous commits 2019-12-26 17:43:28 +03:00
Denis Zharkov 0b385cc532 NI: Approximate captured-for-star-projections to *
^KT-35602 Fixed
2019-12-26 12:35:32 +03:00
Pavel Kirpichenkov 77e4212774 [minor] unmute fixed spec tests 2019-12-25 14:59:06 +03:00
Pavel Kirpichenkov 7ee71450bc [NI] Discriminate Nothing? result type from nullability constraints
Nullability constraints should not be chosen when proper
argument constraints for variables in contravariant position present.

^KT-32106 Fixed
^KT-33166 Fixed
2019-12-25 14:59:06 +03:00
Mikhail Zarechenskiy ae1630f376 [NI] Don't discriminate Nothing-type from resulting ones
^KT-32106 Fixed
2019-12-25 14:59:04 +03:00
victor.petukhov be8ae24713 Temporary mute some spec tests through apply changes after 45e881f03f 2019-12-25 12:44:54 +03:00
Nikolay Krasko e99dc0f87f Show only unique diagnostics in psi checker (KT-35578)
MissingDependencyClassChecker.collectDiagnostics now show only unique diagnostics

As per-file analyzer trace used in checker delegates to resolve session trace, diagnostics might be duplicated because of race condition:
 1. If a non-checker thread performs analyze first, diagnostics for global elements will be stored in the resolve session trace only once.
 2 If the checker threads comes to the analyze first, diagnostics will be stored in the local trace, and after that might be duplicated in the resolve session trace by other analyzers.

 #KT-35578 Fixed
2019-12-20 02:39:05 +03:00
Mikhail Zarechenskiy e0fb586aaf [NI] Don't loose diagnostic after type variable fixation
#KT-24488 Fixed
2019-10-31 11:32:02 +03:00
Mikhail Zarechenskiy 932d84d568 Fix performance regression in NI by fixing totally incorrect hashCode
The actual problem was introduced in 4f1e85b468, note how `hashCode` is implemented:
```
var currentHashCode = cachedHashCode
if (currentHashCode == 0) return currentHashCode
...
```
It's a silly bug, there should be check `if (currentHashCode != 0) ...` because `0` is used a marker for "uncomputed value".

Now, in the commit 0219b86d06 I added map with `KotlinType` as a key and because of constant `hash` for `KotlinType`, we basically got `List` instead of `Map`, which caused this performance regression

 #KT-34063 Fixed
2019-09-30 10:22:30 +03:00
victor.petukhov d8e5b068d5 Relinking spec tests 2019-08-19 18:31:46 +03:00
victor.petukhov cf692fb257 Implement tests map generator and refactor folder structure to spec tests linking 2019-08-19 18:31:40 +03:00
victor.petukhov 28da325a11 Actualize DFA spec tests 2019-08-19 18:31:39 +03:00
Dmitriy Novozhilov 9f90486893 [Misc] Update spec testData according changes in NI 2019-07-30 12:41:41 +03:00