Mikhail Glukhikh
949a39b80f
K2: add checker detecting protected Java field shadowed by a property
2023-01-09 21:37:22 +00:00
Mikhail Glukhikh
59bafedd8a
K2 resolve: prefer derived class property to base class field
...
#KT-50082 Fixed
2023-01-09 21:37:21 +00:00
pyos
923837f26b
FIR: keep nullability when serializing suspend function types
...
No clue where to put the test for that since diagnostic tests, even
multi-module ones, never touch the metadata serializer. So the test is
a bytecode text one pretending to be about nullability annotations even
though it also affects what resolution in another module will do.
2023-01-06 13:54:35 +01:00
Mikhail Glukhikh
1344a9b1bb
ConeTypeIntersector: preserve raw & dynamic types as is
2023-01-04 18:29:34 +00:00
Mikhail Glukhikh
55fdb43620
ConeTypeIntersector: drop obsolete comment
2023-01-04 18:29:34 +00:00
Mikhail Glukhikh
b5111d101e
ConeTypeIntersector: reuse isNullableType from type context
2023-01-04 18:29:34 +00:00
pyos
ee6af9af5f
FIR: intersect flexible type bounds separately
...
^KT-54522 Fixed
2023-01-04 18:29:33 +00:00
Mikhail Glukhikh
8bc9fd91d5
ConeTypeIntersector: inline flatIntersectionTypes
2023-01-04 18:29:33 +00:00
pyos
45e884ec67
FIR: refactor ConeTypeIntersector
2023-01-04 18:29:33 +00:00
Kirill Rakhman
721a37f7e7
K2: implement FirLateinitIntrinsicApplicabilityChecker ^KT-55495 Fixed
2023-01-04 14:42:43 +00:00
Mikhail Glukhikh
0d50f71fb8
K2: expand type aliases in annotation position #KT-55615 Fixed
2023-01-04 10:06:39 +00:00
Denis.Zharkov
24bd7e5eef
K2: Optimize use-site member and intersection scopes
...
Avoid creating cache keys for names that are definitely absent
2022-12-28 18:22:47 +00:00
Denis.Zharkov
db3b7c4021
K2: Optimize ConeInferenceContext::containsInternal
...
We don't call it recursively on recursive types,
thus 'visited' set looks irrelevant.
2022-12-28 17:39:28 +00:00
Ilya Kirillov
396ac6f5e3
[FIR] make FirCorrespondingSupertypesCache to be thread safe
...
^KT-50244
2022-12-27 13:27:24 +00:00
Dmitriy Novozhilov
b53c4a6353
[FIR] Introduce some typed FirReference.toResolvedXXXSymbol utilities
2022-12-15 12:12:20 +00:00
Dmitriy Novozhilov
cffc32ec76
[FIR] Fir utils for FirReference in package org.jetbrains.kotlin.fir.references
2022-12-15 12:12:20 +00:00
Mikhail Glukhikh
df5aa59185
K2: Don't use FirTypeParameterSymbol.resolvedBounds() from inference
2022-12-12 16:21:05 +00:00
Dmitriy Novozhilov
aaf0a1f396
[FIR] Introduce shouldNotBeCalled utility function
2022-12-01 07:29:38 +00:00
Evgeniy.Zhelenskiy
9f01ccc304
[IR] Support user-defined equals for MFVC
...
Signed-off-by: Evgeniy.Zhelenskiy <Evgeniy.Zhelenskiy@jetbrains.com >
#KT-1179
2022-11-30 18:55:36 +00:00
Yan Zhulanow
c7f9d7f027
[FE] Pass the derived class tag to more places (KTIJ-22808)
2022-11-30 04:12:27 +00:00
Yan Zhulanow
0e050ae7f1
[FE] Consider derived class tag on caching substitution scopes
2022-11-30 04:12:27 +00:00
Yan Zhulanow
fe69b21aed
[FE] Fix 'containingClassForStaticMemberAttr' for fake overrides (KTIJ-22808)
2022-11-30 04:12:26 +00:00
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
Mikhail Glukhikh
237f357016
FIR: don't copy initializer for field override, unwrap it instead
2022-11-28 17:27:50 +00:00
Mikhail Glukhikh
c698d060c6
FIR2IR: support static fake overrides for fields (related to KT-53441)
...
#KT-54921 Fixed
2022-11-28 17:27:50 +00:00
Ilya Chernikov
cc9a7480a2
K2 Scripting: add FIR2IR conversion for FirScript
2022-11-26 18:01:49 +00:00
Ilya Chernikov
a3a1550933
K2 scripting: add initial scripting support to K2 frontend
2022-11-26 18:01:48 +00:00
Ivan Kochurkin
194d1cfccf
[FIR] Filter out incorrect library provides for dependencyProviders
...
Get rid of providers duplication
2022-11-23 18:29:29 +00:00
Ilya Kirillov
7781ad67d4
[FIR] introduce FirValueParameter.containingFunctionSymbol
...
^KT-55034 fixed
2022-11-22 18:25:30 +01:00
Dmitriy Novozhilov
eb8ce449e3
[FIR] Don't lose flexible types during capturing from expression
2022-11-22 15:46:22 +00:00
Dmitriy Novozhilov
01c6c7dc59
[FIR] Properly approximate return type of callable declarations
...
- approximate intersection types in all non-local declarations
- approximate local types in non-private non-local declarations
2022-11-22 15:46:20 +00:00
Dmitriy Novozhilov
991d8c18aa
[FIR] Fix incorrect inference of return type of anonymous functions
...
Also remove incorrect subtype check checkers
Test unsafeVarianceInAliasedFunctionalType.kt started to fail because
of KT-54894. This bug existed before, changes from this commit just
unhided it (previously it was hidden because incorrect subtype check
in `isSubtypeForTypeMismatch` which is used by FirFunctionReturnTypeMismatchChecker
2022-11-22 15:46:19 +00: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
82c39187f6
[FIR] Refactor: rename function
2022-11-22 15:46:18 +00:00
Ilya Kirillov
b6481ed891
[FIR] do not use FirValueParameter for function type parameter
...
As it is a different abstraction, introduced FirFunctionTypeParameter instead
Also, fix syntax checkers for function type parameter
^KT-55035 fixed
2022-11-21 16:17:51 +00:00
Dmitrii Gridin
86422d0944
[FIR] FirReceiverParameter: rename type to typeRef
...
^KT-54417
2022-11-17 09:50:17 +00:00
Dmitrii Gridin
be7d282974
[FIR] introduce FirReceiverParameter
...
^KT-54417
2022-11-17 09:50:09 +00:00
Ilya Chernikov
dfa1e8d03d
FIR: fix findClassRepresentation for dynamic type
...
related to KT-53463 and KT-53464
needed e.g. to find proper (fake) override on calls on dynamic receiver
fixes test js/js.translator/testData/box/dynamic/equals.kt
2022-11-12 16:28:23 +01:00
Mikhail Glukhikh
4dc7b6dddc
K2: fix/universalize logic to determine that member is from Java
2022-11-11 13:30:40 +00:00
Mikhail Glukhikh
08d351db57
K2: unify all importing data logic inside FirAbstractImportingScope
2022-11-11 13:30:39 +00:00
Mikhail Glukhikh
e46978f7b3
K2: simplify visibility check for static qualifiers
2022-11-11 13:30:38 +00:00
Mikhail Glukhikh
3a81174a4c
FIR2IR: support static fake overrides (functions) #KT-53441 Fixed
2022-11-11 13:30:36 +00:00
Mikhail Glukhikh
f070401bb5
K2: fix visibility checks for static overrides via imported from static
...
#KT-53441 In Progress
2022-11-11 13:30:35 +00:00
Mikhail Glukhikh
cc1a094b6c
K2: rename importedFromObject -> importedFromObjectOrStatic
2022-11-11 13:30:34 +00:00
Mikhail Glukhikh
2b2cc07c89
FirObjectImportedCallableScope: fix wrong variable name
2022-11-11 13:30:34 +00:00
Mikhail Glukhikh
d16a4ae647
FirClassSubstitutionScope: partial cleanup
2022-11-11 13:30:33 +00:00
Mikhail Glukhikh
d4fc2248ff
FIR: make class member helper names more consistent
2022-11-11 13:30:32 +00:00
pyos
e2a83a0ed0
FIR: unwrap intersection overrides when looking for owner class
...
But not substitution overrides! This is important if the method called
is an intersection override where one of the intersected types is a
subtype of a generic type.
2022-11-11 13:30:32 +00:00
pyos
9f65c6022c
Move substitution override unwrapping to FirVisibilityChecker
...
This is because it is only needed for the declaration itself, not for
the containing class. Currently there is no difference because
`containingNonLocalClass` will look at the dispatch receiver argument if
one exists anyway, and for substitution/intersection overrides one must
exist.
2022-11-11 13:30:31 +00:00
Yan Zhulanow
48fbb62658
[FE] Add missing 'originalForSubstitutionOverrideAttr' to parameters
...
'originalForSubstitutionOverrideAttr' is supposed to be on all
'SubstitutionOverride' declarations, and certain functionality, such as
'KtFirOverrideInfoProvider#getOriginalOverriddenSymbol()' depends on it.
Absence of the attribute might trigger infinite loop/recursion in
substitution unwrapping.
2022-11-11 11:28:36 +00:00