Commit Graph

94 Commits

Author SHA1 Message Date
Victor Petukhov 64c682f465 Remove constraints containing stub types after completion of the common system of a builder inference call
^KT-49285 Fixed
2021-10-26 19:37:59 +03:00
Victor Petukhov 43e9c1223a Take into account possible passed old captured type in isCapturedTypeFromSubtyping check
^KT-48590 Fixed
2021-10-26 19:37:55 +03:00
Tianyu Geng 826ea122a9 FIR checker: DSL_SCOPE_VIOLATION 2021-10-05 15:30:37 +03:00
Mark Punzalan 41a1fa25e2 FIR: Add ConeVisibilityError to distinguish between candidates that are
invisible versus hidden due to deprecation.
2021-09-29 19:39:15 +03:00
Victor Petukhov ee728b6902 Use the new type inference for top-level callable reference resolution
^KT-47797 Fixed
^KT-47987 Fixed
^KT-45034 Fixed
^KT-48446 Fixed
^KT-13934 Fixed
2021-09-27 16:12:27 +03:00
Tianyu Geng 05fbed68e2 FIR checker: report PROPERTY_AS_OPERATOR 2021-09-10 07:07:43 +03:00
Denis.Zharkov d91155558b Rename LF: DefinitelyNotNullTypeParameters -> DefinitelyNonNullableTypes 2021-08-31 15:41:17 +03:00
Dmitriy Novozhilov 7e6e0a3dd6 Remove all type system-specific inheritors of TypeCheckerState 2021-08-26 10:08:51 +03:00
Dmitriy Novozhilov 3f6738c8bc Remove all type system dependent methods from TypeCheckerState 2021-08-26 10:08:51 +03:00
Dmitriy Novozhilov e07512a847 Delegate refineType and prepareType in TypeCheckerState to special services
This is needed to add ability to create type system independent TypeCheckerState
2021-08-26 10:08:51 +03:00
Dmitriy Novozhilov 8b5548df49 Rename AbstractTypeCheckerContext to TypeCheckerState 2021-08-26 10:08:51 +03:00
Ivan Kochurkin 34cc7e5199 [FIR] Fix resolving to star import member instead of builtin (^KT-48157 Fixed) 2021-08-25 21:53:23 +00:00
Ivan Kochurkin bb27ae2b42 [FIR] Fix incorrect resolve of callable reference in function signature (^KT-48304 Fixed) 2021-08-25 21:53:23 +00:00
Matthew Gharrity e27b75bfba Check for cancelation during type inference
This should slightly mitigate the UI freezes caused by KT-47545.
2021-08-20 16:49:42 +03:00
Victor Petukhov 55811c8851 Don't use builder inference if possible
The builder inference is running only if there are still uninferred type variables

^KT-48193 Fixed
2021-08-20 01:28:10 +03:00
Victor Petukhov 261a04b587 Rename "coroutine( inference) *" stuff into "builder inference *" 2021-08-20 01:28:05 +03:00
Ivan Kochurkin 301f446433 Restore KtModifierKeywordToken instead of String in modifier diagnostics
Remove KeywordType
2021-08-18 00:45:57 +03:00
Ivan Kochurkin e85940a1ac Unbind modifiers checks from psi
Use common code in FE and FIR in modifier checker, refactor
2021-08-13 18:32:26 +03:00
Tianyu Geng cd99c35649 FIR: instantiate type argument to captured type if needed 2021-08-09 14:38:30 +03:00
Tianyu Geng bcf6582af7 FIR checker: make TypeApproximatorConfiguration.capturedType consistent with others 2021-08-09 14:38:30 +03:00
Victor Petukhov 93f9d9dacd Check if the intersecting types aren't empty during finding the result type for variable fixation
^KT-47941 Fixed
2021-08-04 17:36:50 +03:00
Dmitriy Novozhilov c3060e861f [FIR] Add expect actual checker 2021-07-20 10:33:49 +03:00
Dmitriy Novozhilov 6e83820f97 Move ExpectActualCompatibility to :compiler:resolution.common 2021-07-20 10:33:33 +03:00
Victor Petukhov 6a1ec92d39 Introduce specific error for calls which could be resolved only with unrestricted builder inference
^KT-47747 Fixed
2021-07-16 19:32:36 +03:00
Victor Petukhov 967304ffca Don't compute default type for a fixing type variable for self type if the corresponding feature is disabled 2021-07-09 19:21:27 +03:00
Victor Petukhov c2cf2f36cd Implement inferring materialized self types through a default type in ResultTypeResolver 2021-07-09 19:21:04 +03:00
Victor Petukhov 3787099a38 Put the type inference on calls with self types under the compiler flag 2021-07-09 19:20:56 +03:00
Victor Petukhov 51c5a54e31 Support type inference for self type materialization calls 2021-07-09 19:20:54 +03:00
Victor Petukhov c3a5a7754d Use proper applicability for constraint warnings
^KT-47316 Fixed
2021-07-09 14:07:01 +03:00
Victor Petukhov 6a78e0a10c Introduce type parameter's upper bound aware type approximator for intersection types 2021-06-22 21:13:54 +03:00
Victor Petukhov 559bedf5ae Continue processing not builder inference stub variables in the type checker during computing common super type
^KT-47148 Fixed
2021-06-15 17:40:56 +03:00
Tianyu Geng ce767046eb FIR checkers: report SMARTCAST_IMPOSSIBLE 2021-06-10 16:01:13 +03:00
Denis.Zharkov 6136526a3a FIR: Avoid reporting inference errors from DelegatedPropertyConstraintPosition
All necessary diagnostics have already been reported through the checkers
2021-06-07 15:25:50 +03:00
Denis.Zharkov c420957eac FIR: Report INFERENCE_NO_INFORMATION_FOR_PARAMETER diagnostic 2021-06-07 15:25:45 +03:00
Victor Petukhov 1e5998e0ba Add constraints between two different stub variables instead of creating constraint error due to T1 isn't subtype of T2
^KT-44241 Fixed
2021-06-03 19:18:09 +03:00
Victor Petukhov 124a14c8df Use separate constraint position during call substitution as part of inferring postponed type variables
^KT-47052 Fixed
^KT-47082 Fixed
2021-06-03 12:37:17 +03:00
Dmitriy Novozhilov 796f8e6bce Revert "FIR checkers: report SMARTCAST_IMPOSSIBLE"
This reverts commit 84334b08
2021-06-03 09:48:50 +03:00
Tianyu Geng 84334b087c FIR checkers: report SMARTCAST_IMPOSSIBLE 2021-06-02 13:19:12 +03:00
Victor Petukhov 9fd1cbd2e7 Inject stub type variables of a different builder inference call properly 2021-05-28 15:36:19 +03:00
Victor Petukhov 0c427555cf Support definitely not null stub types and proper subtyping on them 2021-05-28 15:36:19 +03:00
Victor Petukhov 5a11450d77 Split stub types into stub type for subtyping and for builder inference and use them in the proper way 2021-05-28 15:36:17 +03:00
Victor Petukhov ac7b459f2a Do subtyping with stub types properly
1) Return stub type if we are calculating super type between two same stub types
2) Return nullable Any if those stub types are different
2021-05-28 15:36:15 +03:00
Denis.Zharkov faa5e46396 FIR: Fix inference case with flexible captured types
Previsously, errors have been ignored because we ignored errors raised
from the completion phase

See the comment above the createConstraintPartForLowerBoundAndFlexibleTypeVariable
2021-05-20 17:24:28 +03:00
Denis.Zharkov dac5c31993 Minor. Simplify ConstraintSystemUtilContext::createArgumentConstraintPosition 2021-05-20 17:24:23 +03:00
Andrey Zinovyev b1c8669b43 [FIR] Resolve infix calls to infix functions only
Implements INFIX_MODIFIER_REQUIRED diagnostics
2021-05-20 13:46:27 +03:00
Victor Petukhov 2239404085 Extract type preparation during type checking to a separate component 2021-05-18 17:52:23 +03:00
Victor Petukhov 7c62e9aecd Introduce warnings reporting by missed constraints because of incorrect optimization in the constraints processor 2021-04-30 15:46:04 +03:00
Victor Petukhov e110b49cab Revert "Don't stop constraints processing if all type variables have proper equality constraints"
This reverts commit b87c2a15
2021-04-30 15:46:03 +03:00
Victor Petukhov 867d7b5bca Allow type variable fixation into intersection type if it isn't meaningless (i.e. has one or more final classes, or two or more open classes)
^KT-46186 Fixed
2021-04-23 15:12:13 +03:00
Tianyu Geng 6a03f31e50 FIR: add UnsafeCall resolution diagnostics
Previously unsafe call is reported as part of InapplicableWrongReceiver.
This makes it difficult for the downstream checkers to report different
diagnostics.
2021-04-19 15:11:13 +03:00