Commit Graph

38905 Commits

Author SHA1 Message Date
Dmitry Petrov d184babda6 JVM_IR fix cast to non-null primitive type (FIR bootstrap issue) 2022-01-13 12:47:00 +00:00
Denis.Zharkov 964cf937c3 Fix IllegalStateException in case of recursive T & Any upper bound
^KT-50542 Fixed
2022-01-13 12:54:47 +03:00
Pavel Kunyavskiy afc548d5d9 [K/N] Fix equality on fun-interface constructor references
^KT-50204
2022-01-13 09:45:58 +00:00
Pavel Punegov a4123a6be9 [K/N][test] Ignore test that fails due to ^KT-50763 2022-01-13 08:31:10 +00:00
Pavel Punegov 49b6545268 [K/N][test] Ignore test that extends final ArrayList (in K/N) 2022-01-13 08:31:09 +00:00
Denis.Zharkov 751e618d83 Enable ProhibitUsingNullableTypeParameterAgainstNotNullAnnotated since 1.8
^KT-36770 Relates
2022-01-13 08:47:20 +03:00
Denis.Zharkov d3b686b28f Minor. Remove effectively unused feature 2022-01-13 08:47:20 +03:00
Denis.Zharkov d87eddaf8b Improve warnings related to type parameter bounds nullability
Explicitly supply the type parameter that needs to be non-nullified

^KT-36770 Relates
2022-01-13 08:47:20 +03:00
Denis.Zharkov 1827165716 Support rendering messages text in diagnostic tests 2022-01-13 08:47:19 +03:00
Pavel Kunyavskiy 541f6b0c88 [K/N] Fix handling of legacy suspend-function superclass
^KT-50737
2022-01-12 19:42:37 +00:00
Dmitriy Novozhilov b2b5f4a63a [FE 1.0] Don't report deprecation diagnostics about enum on it's own entries
^KT-37975 Fixed
2022-01-12 19:11:28 +03:00
Nikita Bobko ca716fd226 Regenerate tests 2022-01-12 15:25:16 +01:00
Nikita Bobko 735d46efb4 Freezable.{frozen, unfrozen} refactoring: add type safety 2022-01-12 15:25:10 +01:00
Victor Petukhov 1f1b5256b0 Postpone type enhancement improvements till 1.7 due to some found broken cases unmarked by warnings before
^KT-49378 Fixed
2022-01-12 15:58:50 +03:00
Andrey Uskov 2adc851f1b Don't use global state for keeping incremental compilation state
Previously IC state was stored in System properties. As result parallel
compilation might cause incorrect state of IC, what led to corruption
of kotlin_module files. Now IC state is stored via CompilerArguments
and CompilerConfiguration
#KT-46038 Fixed
2022-01-12 13:37:46 +03:00
Dmitriy Dolovov 99300bd885 [IR] IrModuleDeserializerKind API cleanup
Related to #KT-50591
2022-01-12 11:05:12 +03:00
Roman Golyshev 54cca88279 KT-50728 Enforce receiver type resolve
When stdlib is represented as a source dependency (which seems to be the
case in the `kotlin` project), it will be resolved lazily for the IDE.
Same thing can happen if someone decides to "extend" the stdlib
by declaring their declaration in the `kotlin` package

In both of those cases, we need to make sure that receiver type is fully
resolved before trying to get a `coneType` from it

N.B. To make resolve tests work, I've added a separate folder
`withAllowedKotlinPackage` to the `testData`, because in the default
test setup it is not allowed to extend the `kotlin` package by user's
definitions

^KT-50728 Fixed
2022-01-11 22:23:57 +00:00
Dmitriy Dolovov 716ca3c319 [IR] Do best effort explaining IR linker issue to the user if computation of the detailed IR linker error message failed due to unexpected error
Related to #KT-50591
2022-01-11 21:53:12 +03:00
Dmitriy Dolovov cb5a052227 [IR] Distinguish IrModuleDeserializers with and w/o underlying KLIBs
Fixes #KT-50591
2022-01-11 21:53:06 +03:00
Jinseong Jeon 7ff468d9e3 FIR LC: populate only const property on multi-file facade 2022-01-11 21:30:54 +03:00
Denis.Zharkov 0da24ff4e2 FIR: Fix smartcast case after equals on class from different module
^KT-50534 Relates
2022-01-11 20:45:56 +03:00
Denis.Zharkov a33d9df0cd NI: Support forking inference with heuristics
Mostly, it only affects FIR

It partially allows to consider several variance of constraints like
A<Int> & A<T> <: A<X_var> that are mostly brought by smart casts

^KT-49542 Fixed
^KT-50489 Relates
2022-01-11 20:45:55 +03:00
Denis.Zharkov 62673c7e1b NI: Do not use asConstraintSystemCompleterContext before completion 2022-01-11 20:45:54 +03:00
Denis.Zharkov 1d258635a2 NI: Get rid of confusing asConstraintSystemCompletionContext
NB: there is a different asConstraintSystemCompleterContext that might have side effects
2022-01-11 20:45:53 +03:00
Denis.Zharkov 47d74a16f2 NI: Get rid of redundant asPostponedArgumentsAnalyzerContext calls 2022-01-11 20:45:53 +03:00
Victor Petukhov 455b3143e7 [FE 1.0] Introduce builder inference stub types checker which may report more precise and clear errors due to resolution ambiguity
^KT-49828 Fixed
2022-01-11 18:34:47 +03:00
Victor Petukhov dcc42d66c3 [FE 1.0] Fix formatting in StubTypesBasedInferenceSession 2022-01-11 18:34:46 +03:00
Victor Petukhov 4dc9b291e5 [FE 1.0] Store builder inference session in the corresponding lambda argument 2022-01-11 18:34:46 +03:00
Victor Petukhov 74f294d849 [FE 1.0] Store constraint system in call resolution result instead of constraint storage 2022-01-11 18:34:45 +03:00
Victor Petukhov cedd98148c [FE 1.0] Rename the remaining coroutine inference stuff into builder inference 2022-01-11 18:34:45 +03:00
Victor Petukhov 27ed4a7dc2 [FE 1.0] Rename DelegatedPropertyInferenceSession to DelegateInferenceSession 2022-01-11 18:34:44 +03:00
Victor Petukhov ab207ca58f [FE 1.0] Rename ManyCandidatesResolver to StubTypesBasedInferenceSession 2022-01-11 18:34:43 +03:00
Victor Petukhov c1d3f7e5b4 [FE 1.0] Rename ambiguity's parameter from descriptors to resolvedCalls 2022-01-11 18:34:42 +03:00
Victor Petukhov 8e2b90b5db [FE 1.0] Don't report CAST_NEVER_SUCCEEDS on stub types
^KT-49829 Fixed
2022-01-11 18:34:41 +03:00
Victor Petukhov 37d163d417 [FE 1.0] Don't lose diagnostics during lambda analysis at the overload resolution by return type stage
^KT-49658 Fixed
2022-01-11 18:07:05 +03:00
vmishenev 7820b268fb KT-50111 Add a new analysis flag eagerResolveOfLightClasses 2022-01-11 17:33:47 +03:00
Roman Golyshev 5964d8c566 KTIJ-20618 FIR IDE: Enforce resolved type bounds in ConeTypeContext.kt
When lazy resolve is involved, type bounds can be in an unresolved
state (e.g. `FirUserTypeRef` instead of `FirResolvedTypeRef`). To
enforce the resolve, we use `resolvedTypeBounds` where it might be
important

^KTIJ-20618 Fixed
2022-01-11 13:56:17 +00:00
Denis.Zharkov a63351f5d1 FIR: Simplify ConeTypeContext.captureArguments 2022-01-11 16:27:06 +03:00
Denis.Zharkov 9be4f818f4 FIR: Weaken some UPPER_BOUND_VIOLATED restrictions
See test data at starProjectionInsteadOutCaptured.kt

^KT-49412 Fixed
^KT-50230 Relates
^KT-48044 Fixed
2022-01-11 16:27:06 +03:00
Denis.Zharkov 814f4803b7 FIR: Refactor extracting type arguments from FirTypeRef
Extract them all instead of re-iterating for each argument
2022-01-11 16:27:05 +03:00
Denis.Zharkov 1a9c389b0e FIR: Refactor ConeSubstitutorByMap
Add explicit equals and cached hashCode instead of implicit ones from data class
2022-01-11 16:27:04 +03:00
Denis.Zharkov b193e708d3 FIR: Refactor checkUpperBoundViolated
There just should be a different facades for cases
A<T1, T2> and foo<T1, T2>()

Test data has changed for type alias constructors since previously,
it was working by mistake because of assumption that type alias arguments
are linearly mapped to the type parameters of the corresponding constructors

^KT-50703 Open
2022-01-11 16:27:03 +03:00
Alexander Udalov 8b57675002 Revert "Remove obsolete check for language version and IR backends"
This check is no longer obsolete since language version 1.3 support is
restored for Kotlin/JVM, but JS and Native never supported LV 1.3.

This is a partial revert of 0213c25c9b,
without the diagnostic in K2JVMCompilerArguments (which is not needed
since the earliest supported LV is 1.3).

 #KT-50695 Fixed
2022-01-10 21:15:51 +01:00
Jinseong Jeon 08d062dcf9 Remove unused/deprecated ReadWriteAccess util
The usage in KtFirCallResolver for resolving compound accessor calls is
fully rewritten recently, and this util is no longer used.

This is partial revert of cd4a08cb18
2022-01-10 19:54:25 +03:00
Pavel Punegov 9df7d39536 [K/N][test] Ignore tests that fail due to the ^KT-50555 2022-01-10 09:01:06 +00:00
Pavel Punegov c4619b4871 [K/N][test] Ignore tests that fail due to the init order
These test run correctly in the new MM
2022-01-10 09:01:06 +00:00
Pavel Punegov 8744e3db74 [K/N][test] Ignore test ^KT-49422 2022-01-10 09:01:05 +00:00
Pavel Punegov 255a254619 [K/N][test] Ignore test ^KT-50289 2022-01-10 09:01:05 +00:00
Pavel Punegov 0fadf14502 [K/N][test] Ignore test ^KT-50399 2022-01-10 09:01:04 +00:00
Pavel Punegov f1fcb56348 [K/N][test] Ignore test ^KT-33091 2022-01-10 09:01:04 +00:00