Dmitriy Novozhilov
ac7fddaad5
[FE] Always infer upper types to intersection types in K2...
...
...and always use old algorithm for K1
^KT-51221
2022-11-29 12:25:44 +00:00
Nikolay Lunyak
7147b7d17b
[FIR] KT-55033: Split runTransaction into smaller functions
...
^KT-55033 Fixed
Merge-request: KT-MR-7779
Merged-by: Nikolay Lunyak <Nikolay.Lunyak@jetbrains.com >
2022-11-25 09:12:15 +00:00
Denis.Zharkov
ca12cfb90d
K2: Do not fix variables that has yet unprocessed constraints in forks
...
Otherwise, exception from org.jetbrains.kotlin.resolve.calls.inference.components.ConstraintInjector.TypeCheckerStateForConstraintInjector.fixedTypeVariable
might happen during forks resolution
The test data is extracted from intelliJ FP test
^KT-43296 Fixed
2022-11-24 17:29:30 +00:00
Denis.Zharkov
10d63cc52a
K2: Postpone inference forks resolution until FULL completion
...
It helps to use expected type information when choosing the branch
even in the nested calls
^KT-43296 In Progress
2022-11-24 17:29:29 +00:00
Denis.Zharkov
c958c79362
Minor cleanup at ConstraintInjector.kt
2022-11-24 17:29:29 +00:00
Denis.Zharkov
02b2927921
Clarify naming around inference fork points
...
^KT-43296 In Progress
2022-11-24 17:29:28 +00:00
Denis.Zharkov
715a73c8fb
K2: Support inference case with a mix of smart-cast and expected type
...
The idea is that we should not fix (i.e. choose any of the fork branches)
on the stage of candidate processing before completion, but it's enough
just to check that current state can be converged to success.
And when completion starts, and we add expected type to the system,
we've got more information to choose the correct fork branch.
NB: The old `processForkConstraints` is being called just
at the beginning of the completion phase.
^KT-43296 In Progress
2022-11-24 17:29:28 +00:00
Jinseong Jeon
c79d65536b
Gracefully handle erroneous super type during local type approximation
...
^KTIJ-23528 Fixed
2022-11-22 20:16:40 +01:00
Dmitriy Novozhilov
32f6b71525
[FE] Add ability to configure PublicDeclaration type approximation configuration
...
This configuration allows to choose what to do with local and anonymous types
2022-11-22 15:46:18 +00:00
Dmitriy Novozhilov
d39c019051
[FE] Add toString to NewConstraintError
2022-10-19 11:09:30 +00:00
Dmitriy Novozhilov
d423782fac
[FE 1.0] Remove usages of safeAs and cast from most of FE 1.0 modules:
...
- :core:descriptors
- :core:descriptors.jvm
- :core:deserialization
- :compiler:cli
- :compiler:frontend
- :compiler:frontend:cfg
- :compiler:frontend.java
- :compiler:frontend.common.jvm
- :compiler:psi
- :compiler:resolution
- :compiler:resolution.common
- :compiler:resolution.common.jvm
- :kotlin-reflect-api
2022-10-12 13:58:56 +00:00
Mikhail Glukhikh
e9bb0f4fda
Resolution: extract projections from captured flexible type properly
...
#KT-54100 Fixed
Related to KT-54196, KT-54198
2022-09-28 15:29:43 +00:00
Mikhail Glukhikh
ed21011183
NewConstraintSystemImpl: remove redundant suppressions
2022-09-19 19:12:20 +00:00
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