Commit Graph

2421 Commits

Author SHA1 Message Date
Ilya Kirillov fe207492b7 FIR: mark declarations resolved to BODY_RESOLVE with BODY_RESOLVE phase in implicit body transformer 2021-03-12 11:43:59 +01:00
Tianyu Geng 9476175cc2 FIR: add mapping to partially resolved arg list
Initially I tried adding `mapping` field to `FirArgumentList` but it
seems to be very difficult to make it flexible enough to do what I want.

So instead, I am creating a `FirPartialResolvedArgumentList`, which
seems to be very simple.
2021-03-11 22:57:58 +03:00
Mikhail Glukhikh 5d3afbad54 Rename: BadNamedArgumentsTarget -> ForbiddenNamedArgumentsTarget 2021-03-11 22:57:57 +03:00
Tianyu Geng be0dd84a06 FIR: check NAMED_ARGUMENTS_NOT_ALLOWED
The check has already been partially implemented in
org.jetbrains.kotlin.fir.resolve.calls.FirCallArgumentsProcessor. This
change completes the missing piece that determines if a `FirFunction`
has stable parameter names.
2021-03-11 22:57:57 +03:00
Jinseong Jeon 55561fad37 FIR CFG: correct target and label for rethrow in try expression
^KT-45385 Fixed
2021-03-11 16:19:16 +03:00
Dmitriy Novozhilov 65ea4e184a [FIR] Fix enhancement of FlexibleNullability and EnhancedNullability
- Add utilities to add new attribute to ConeAttributes
- Get rid of FlexibleNullability attribute (it can be easily inferred
    for any flexible type at any moment)
- Fix determining of EnhancedNullability attribute
2021-03-11 13:10:04 +03:00
Mikhail Glukhikh f3135baba9 FIR: eliminate replaceSource usages in transformTypeToArrayType 2021-03-10 22:23:21 +03:00
Ilya Kirillov d8a3dacdc5 FIR: return back supertypeRefs list recreation 2021-03-09 15:41:42 +01:00
Jinseong Jeon 6427117a35 FIR CFG: correct edge label from a node that returns Nothing
If it's not within a try/catch/finally, that should be an uncaught
exception path.

^KT-45327 Fixed
2021-03-09 14:44:42 +03:00
Andrei Klunnyi a0b901b23a Revert "[FIR]: sealed hierarchy processor for IDE"
This reverts commit e6ccdff2
2021-03-05 16:37:47 +01:00
Andrei Klunnyi e6ccdff2f7 [FIR]: sealed hierarchy processor for IDE
From now on sealed declarations get resolved with the help of
FirIdeSealedHierarchyProcessor. This change entails correct IDE side
check for sealed when exhaustiveness.
2021-03-05 10:20:19 +00:00
Jinseong Jeon d348e58183 FIR: rename util to retrieve primary constructor 2021-03-04 17:56:30 +03:00
Dmitriy Novozhilov a6d1d47918 [FIR] Fix clearing info about DF variable after reassignment 2021-03-04 17:09:17 +03:00
Dmitriy Novozhilov f8adce8b96 [FIR] Cleanup data flow analysis of safe calls 2021-03-04 17:09:17 +03:00
Mikhail Glukhikh b7cb39fdd1 Drop/inline unused members of FirTowerDataContextsForClassParts 2021-03-03 17:15:26 +03:00
Mikhail Glukhikh b2b502338a FIR: move lambda / reference specific contexts to general context parts 2021-03-03 17:15:26 +03:00
Mikhail Glukhikh eca1256d7e FIR: refactor property & initializer resolve 2021-03-03 17:15:26 +03:00
Mikhail Glukhikh 130e3552ea Unite different tower contexts in FirTowerDataContextsForClassParts 2021-03-03 17:15:26 +03:00
Jinseong Jeon 5923cbd76f FIR: remove unnecessary override in PreliminaryLoopVisitor 2021-03-03 12:27:12 +03:00
Jinseong Jeon f1fa290d49 FIR checker: report val reassignment 2021-03-03 12:27:11 +03:00
Dmitriy Novozhilov da0fd7cc15 [FIR2IR] Approximate non-denotable types when converting ConeType to IrType 2021-03-02 19:11:21 +03:00
Dmitriy Novozhilov c271f953d7 [FIR] Introduce ConeTypeApproximator 2021-03-02 19:11:20 +03:00
Tianyu Geng 17617ffd3f IDE FIR: fix resolving vararg parameter type
For a vararg parameter type, there corresponding FIR element has a fake
source of kind ArrayTypeFromVarargParameter. As a result,
`getOrBuildFir` returns the whole `FirValueParameter` for the parameter
type reference. Therefore, we need some special handling for this case
in order to resolve the proper `KtSymbol`.
2021-03-02 12:46:55 +01:00
Jinseong Jeon 856838f82c FIR: refactor delegate unwrapping
Not implemented override checker will use those to pretend to make
delegeted members (before checking similarly pretended fake overrides)
2021-02-26 13:50:24 +03:00
Denis.Zharkov 4fffe7b9c8 FIR: Fix VerifyError caused by private delegates
^KT-45048 Fixed
2021-02-25 19:30:15 +03:00
Denis.Zharkov ace66b7179 FIR: Prettify visibility resolution for private constructors 2021-02-25 19:30:15 +03:00
Denis.Zharkov 9d7e40ad99 Minor. Reformat FirStatusResolveTransformer.kt 2021-02-25 19:30:15 +03:00
Ilya Kirillov f4371c670e Move WhenMissingCase from fir module to compiler.common to use in IDE 2021-02-24 20:13:42 +01:00
Ilya Kirillov 83f8650e80 Move CallableId from fir module to compiler.common to use in IDE 2021-02-24 20:13:41 +01:00
Jinseong Jeon 338595703c FIR: delegate to abstract override members of Any 2021-02-24 13:50:46 +03:00
Jinseong Jeon c4af92a86a FIR: don't raise an internal error for sealed members in intersection scope 2021-02-24 13:50:45 +03:00
Denis.Zharkov 1fe0a1f160 FIR: Fix interface delegation case via type alias 2021-02-20 10:59:23 +03:00
Denis.Zharkov 45018ea468 FIR: Rework loading overrides of special built-in methods from Java
Some of the changed data is correct, but some diagnostics are incorrect
Corner cases like having both contains(Object) and contains(String)
within implementation of Collection<String> is not supported
2021-02-20 10:59:21 +03:00
Denis.Zharkov 23705a269f FIR: Fix supertype scopes for local classes
Do not use ClassId as it can't be a key for local classes
2021-02-20 10:59:21 +03:00
Denis.Zharkov 6766c8fe47 FIR: Simplify supertypes scopes computation 2021-02-20 10:59:20 +03:00
Denis.Zharkov 31b9be2d01 FIR: Extract ConeKotlinType::scopeForSupertype 2021-02-20 10:59:20 +03:00
Dmitriy Novozhilov cd8f597e2f [FIR] Fix building callable reference adaptation against flexible types
#KT-45052 Fixed
2021-02-20 10:23:34 +03:00
Dmitriy Novozhilov 469252f6b4 [FIR] Don't create smartcast node if smartcasted type is equal to original type 2021-02-20 10:23:33 +03:00
Dmitriy Novozhilov 1c0d862e40 [FIR] Don't smartcast variables to invisible types
#KT-44802 Fixed
2021-02-20 10:23:33 +03:00
Mikhail Glukhikh 742f1e0069 FIR: add replaceSource to all FIR tree nodes 2021-02-19 18:24:45 +03:00
Dmitriy Novozhilov d40777c28f [FIR] Fix calculating arguments of bare type with intersection type as base 2021-02-19 16:23:24 +03:00
Dmitriy Novozhilov 3626008ed2 [Inference] Add ability to approximate local types in AbstractTypeApproximator 2021-02-19 12:47:27 +03:00
Mikhail Glukhikh 357a7907a3 FIR: fix type approximation by visibility 2021-02-19 10:39:57 +03:00
Roman Golyshev 74bdb2398e FIR: Get rid of PSI dependency in the :fir:resolve module 2021-02-19 07:20:06 +00:00
Mikhail Glukhikh 3e9ff3ecda FIR: report SUPERTYPE_NOT_A_CLASS_OR_INTERFACE on type parameters 2021-02-19 10:17:17 +03:00
Jinseong Jeon 5f9357eb41 FIR: transform implicit type ref in anonymous function arguments & body
^KT-45010 Fixed
2021-02-19 10:17:16 +03:00
Jinseong Jeon a841a0bbca FIR: transform other parts of function call even though callee is an error 2021-02-19 10:17:16 +03:00
Jinseong Jeon 27c942a0ff FIR: enforce the return type of function literals without body
Its return type should be Unit, so do not use the expected type from,
e.g., parameter type.
2021-02-19 10:17:16 +03:00
Jinseong Jeon 9aaa952b39 FIR: regard implicit type for value parameter after body resolve as an error type 2021-02-19 10:17:16 +03:00
Jinseong Jeon fbb19e3b50 FIR: ensure type ref transformed by type resolve transformer is resolved 2021-02-19 10:17:15 +03:00