Commit Graph

147 Commits

Author SHA1 Message Date
Mikhail Glukhikh 3e58c54da9 Add docs to CandidateApplicability, remove DSL_SCOPE_VIOLATION 2022-07-27 15:29:48 +00:00
Mikhail Glukhikh d0c518013a Document&use CandidateApplicability.shouldStopResolve/isSuccess properly 2022-07-27 15:29:47 +00:00
Mikhail Glukhikh 0611f3b8e7 CandidateApplicability: add K1/K2 prefixes when applicable 2022-07-27 15:29:44 +00:00
Mikhail Glukhikh 8e9e8302f7 CandidateApplicability: merge INAPPLICABLE_MODIFIER into CONVENTION_ERROR 2022-07-27 15:29:43 +00:00
Mikhail Glukhikh 32a73968de Stop tower resolve in K2 in more similar manner with K1 2022-07-27 15:29:41 +00:00
Victor Petukhov b472ccd358 [FE 1.0] Introduce deprecation of inferred type variable into a declared upper bound within a builder inference call 2022-05-31 14:13:29 +00:00
Victor Petukhov 867ad24c86 [FE] Show causing types in the INFERRED_TYPE_VARIABLE_INTO_EMPTY_INTERSECTION diagnostic 2022-05-27 15:14:24 +00:00
Victor Petukhov 6a34b184ac [FE] Introduce warnings on possible empty intersection types, and improve errors reporting in general
^KT-52361 Fixed
2022-05-27 15:14:23 +00:00
Victor Petukhov e133ee3765 [FE] Cache checking intersection type emptiness results 2022-05-27 15:14:23 +00:00
Victor Petukhov 02a430875f [FE 1.0] Don't fail candidates which were marked with compatibility resolve previously
^KT-52431 Fixed
^KT-52393 Fixed
2022-05-27 15:14:22 +00:00
Victor Petukhov c25e07119c [FE 1.0] Skip improper constraints while determining READY_FOR_FIXATION_DECLARED_UPPER_BOUND_WITH_SELF_TYPES type variable readiness
^KT-51148 Fixed
2022-05-27 13:56:32 +00:00
Dmitriy Novozhilov de842817e8 [FE] Move ExpectActualCompatibility to :core:compiler.common module 2022-05-20 13:33:03 +00:00
Denis.Zharkov c018270462 Support DNN types in approximator
Mostly, it's relevant to FIR since there we started loading
type parameter based types as (T & Any..T?)
2022-05-19 16:54:06 +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
Victor Petukhov 6027c2a9aa [FE] Substitute fixed type variables with inferred stub types
Actually, a type variable might be fixed into a stub type. Such stub type should be substituted before sub calls completion

^KT-51988 Fixed
2022-05-09 12:38:37 +00:00
Victor Petukhov e0a1f1c405 [FE] Review fixes 2022-04-27 19:50:24 +00:00
Victor Petukhov 47d6236a2d [FIR] Support determining emptiness of an intersection type with type parameters' types 2022-04-27 19:50:23 +00:00
Victor Petukhov 5bfe6cd20a [FE] Implement discussed rules to report empty intersection errors 2022-04-27 19:50:22 +00:00
Victor Petukhov b96708c3e2 [FE] Support reporting INFERRED_TYPE_VARIABLE_INTO_EMPTY_INTERSECTION for empty intersection types with type parameters 2022-04-27 19:50:21 +00:00
Victor Petukhov 9e9e0211eb [FE] Check if type variable is fixed into an empty intersection type and report resolution warnings/errors if needed (completion stage)
^KT-51221 Fixed
2022-04-27 19:50:18 +00:00
Victor Petukhov b5933c70e2 [FE 1.0] Refactor error utils: split error entities and introduce error type and error scope kinds 2022-03-23 21:13:33 +00:00
Simon Ogorodnik 7fa13f758f Make constraint system fail hard on registering existing variable 2022-03-18 12:14:00 +00:00
Victor Petukhov fd6500c167 [FE 1.0] Set a fixation priority for self type variables less than any of ready for fixation kinds
^KT-51040 Fixed
^KT-49838
2022-02-14 15:43:53 +03:00
Ivan Kochurkin 635166c969 [FIR] Get rid of excess allocations in FlatSignature 2022-02-07 17:22:00 +03:00
Dmitriy Novozhilov 52b72a7dac [FIR] Implement Int -> Long conversions for literals and operators over them
^KT-38895
^KT-50996 Fixed
^KT-51000 Fixed
^KT-51003 Fixed
^KT-51018 Fixed
2022-02-07 13:36:36 +03:00
Simon Ogorodnik 83ff0946fe Inference. Remove chain inference stubs from fixed variables constraints 2022-01-22 09:02:02 +03:00
Mikhail Glukhikh e8be9d4861 FIR: support don't use builder inference if possible
In this commit we upgrade FIR builder inference logic from
the compiler version to 1.7. FIR-based compiler now works with
"don't use builder inference" flag always ON and supports switching
the flag "use builder inference only if needed". To do it,
ContraintSystemCompleter (FIR) and KotlinConstraintSystemCompleter (FE 1.0)
are made similar with extracting some common parts into
ConstraintSystemCompletionContext.

Test status: one BB test fails after this commit (KT-49285).
Also we have a crush in DFA logic in FIR bootstrap test and somehow
questionable behavior in FIR diagnostic test. However,
two BB tests were fixed, the 3rd case from KT-49925 were also fixed.

#KT-49925 Fixed
2022-01-20 23:46:36 +03:00
Dmitriy Novozhilov fbab32c4dd [FIR] Remove redundant nullability from findFunctionalTypesInConstraints return type 2022-01-20 11:25:46 +03:00
Pavel Kirpichenkov b4c854429f [MPP] Permit const actual properties for non-const expects
It's safe as not having const is more restrictive, therefore can be
allowed in common. Otherwise, it's not possible to declare an expect
declaration for a platform property with `const` modifier in common

KT-18856
2022-01-19 13:22:47 +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 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
Irene Dea 13bff10567 Fix union related failures. 2022-01-08 15:26:44 +03:00
Irene Dea a98e2c4e03 Fix failed tests 2022-01-08 15:26:44 +03:00
Irene Dea 19bfc43bee Fixes and refactors 2022-01-08 15:25:07 +03:00
Irene Dea 56d817b49f Union type attributes for common super type calculation 2022-01-08 15:25:07 +03:00
Simon Ogorodnik 8b23d86bd9 Treat mixed (subtyping, inference) sub-types properly in CST 2021-12-15 22:23:18 +03:00
Victor Petukhov b3943f5ab6 [FE 1.0] Process builder inference stub types with different nullability properly
^KT-49887 Fixed
2021-12-15 22:23:18 +03:00
Simon Ogorodnik 8cf97127fe Add util for safe registration of type variables in constraint system 2021-12-15 22:23:16 +03:00
Simon Ogorodnik 5efbd016bd Inference: Respect stub-type nullability in common super-type 2021-12-15 22:23:00 +03:00
Simon Ogorodnik 7b8ece8758 FIR: Make constraint injector treat stub types as type variables 2021-12-15 22:22:55 +03:00
Simon Ogorodnik 6cf2c6f93a Select non-DeclaredUpperBound for initial when simplifying constraint 2021-12-15 22:22:52 +03:00
Simon Ogorodnik 91b629d16a Refactor. Remove ConstraintPosition data duplication 2021-12-15 22:22:52 +03:00
Tianyu Geng a5844b754e Type Approximation: add separate flag to control approx. anonymous type
This extra flexibility is useful for IDE where we always want to
approximate anonymous types but may not want to approximate other local
 types
2021-12-15 16:09:27 +03:00
Anastasia.Shadrina 343a860553 [FE] Make OverloadChecker take CR into account 2021-12-14 15:19:42 +03:00
Victor Petukhov ce2c6f5d1f [FE 1.0] Don't mark type variable as READY_FOR_FIXATION_DECLARED_UPPER_BOUND_WITH_SELF_TYPES if it has complex dependency to other type variables
^KT-49838 Fixed
2021-12-07 11:41:13 +03:00
Anastasiya Shadrina a091b345a0 [FE] Provide overloadability for candidates with different CR 2021-12-02 20:24:19 +03:00
Anastasiya Shadrina f427265739 [FE] Resolve overload conflict between contextual and non-contextual declarations 2021-12-02 20:24:03 +03:00
Anastasiya Shadrina 37495bcba0 [FE] Change resolution scheme 2021-12-02 20:23:57 +03:00
Denis.Zharkov 0d9ad62d4a Fix inference for lambdas with with extension function expected type
^KT-49832 Fixed
^KT-49836 Fixed
2021-11-26 19:39:51 +03:00
Denis.Zharkov 3fb17cfa9a Minor. Reformat PostponedArgumentInputTypesResolver.kt 2021-11-26 19:39:50 +03:00