Mads Ager
dfc86feecd
[IR] Extend test coverage for smart cast handling.
2021-01-11 12:01:48 +03:00
Mads Ager
6fc0de39c2
[PSI2IR] Propagate smart cast information for variable loads.
...
This gives us more precise type information and can enable backend
optimizations. This was motivated by when expressions not compiled
to table switches in the JVM_IR backend.
Fixed KT-36845.
2021-01-11 12:01:47 +03:00
Roman Artemev
826985450e
Add test for KT-42036
2020-12-29 16:27:31 +03:00
Victor Petukhov
07b6f0d871
Fix failing tests
2020-12-25 14:29:11 +03:00
Mikhail Glukhikh
0d40fde713
FIR synthetics: make setter subtype check more precise #KT-43347 Fixed
2020-12-25 14:07:28 +03:00
Victor Petukhov
954c9cecca
Compute type for callable references and lambdas inside not null assertion if couldn't get already recorded type
2020-12-25 11:52:59 +03:00
Dmitry Petrov
0841a6b0ea
irText tests for KT-19306
2020-12-23 21:50:06 +03:00
Georgy Bronnikov
b35d4134a7
Psi2IR: workaround for IR-based descriptors
...
Since KotlinTypes involving IR-Based descriptors are distinct from KotlinTypes
involving original descriptors of the same declarations, subtyping check
breaks in InsertImplicitCasts.
2020-12-23 18:50:53 +03:00
Georgy Bronnikov
076272f7ca
FIR2IR: avoid descriptors computing hashCode
...
When synthesizing the hashCode function for data classes, descriptors
were used, in partcular, memberScope for primitive classes.
IrBasedDescriptors have no member scope, so we compute the hashCode
function based on IR structures.
2020-12-23 18:50:52 +03:00
Jinseong Jeon
73576c80e4
FIR2IR: calculate IR parent for Java field ahead
...
so as to cache type parameters from the parent if the field's return
type is one of type parameters.
#KT-44032 Fixed
2020-12-23 09:10:52 +03:00
Jinseong Jeon
e05d26b9b0
FIR2IR: cache type parameters in delegated property
...
#KT-44030 Fixed
2020-12-22 12:05:31 +03:00
Jinseong Jeon
d753d21dee
FIR2IR: don't add SAM conversion for explicit subtype cases
2020-12-21 18:01:27 +03:00
Jinseong Jeon
3bca6ae893
FIR: allow lower bound of flexible type when finding contributed invoke
2020-12-21 18:01:25 +03:00
Jinseong Jeon
d5a6991b2d
FIR: extend SAM conversion to subtype of functional type
2020-12-21 18:01:22 +03:00
Jinseong Jeon
9c2d06cf70
FIR: strengthen resolution success check for augmented array set call
...
This commit removes some false ambiguities &
fixes compilation of tree-generator module with FIR
2020-12-18 14:24:24 +03:00
Jinseong Jeon
fe0c25693d
FIR2IR: do not convert @ExtensionFunctionType twice
2020-12-18 12:17:21 +03:00
Jinseong Jeon
4ab0897d7d
FIR: pass the explicit expected type to block type
...
This helps avoid adding redundant return Unit into block.
2020-12-15 17:52:48 +03:00
Dmitry Petrov
b0f6461fa9
JVM_IR KT-42020 special IdSignature for some fake override members
2020-12-15 12:56:45 +03:00
Jinseong Jeon
f7ade2b0b8
FIR2IR: introduce implicit casts for extension receivers
2020-12-15 11:52:49 +03:00
Jinseong Jeon
8f2ad57f7a
FIR: pass elvis expected type to lhs/rhs
2020-12-10 20:52:49 +03:00
Mikhail Glukhikh
d6e144c80e
[FIR] Extend callableNames known for JvmMappedScope
2020-12-09 19:53:23 +03:00
Dmitry Petrov
69c88a8a0a
PSI2IR KT-41284 use getters for open data class property values
...
'allopen' compiler plug-in can make data classes and their members open,
which is a compilation error in usual case, but makes sense for Spring
and other frameworks that generate proxy-classes.
2020-12-09 10:29:09 +03:00
Jinseong Jeon
cdfe1771d9
FIR DFA: reimplement type OR operation to its original semantics
...
#KT-43569 Fixed
2020-12-07 10:50:19 +03:00
Jinseong Jeon
7ea58adc50
FIR: reproduce KT-43569
2020-12-07 10:50:19 +03:00
Mikhail Glukhikh
2429f429c5
[FIR] Set isStubTypeEqualsToAnything = true for inference as in FE 1.0
...
#KT-43616 Fixed
2020-12-02 14:49:08 +03:00
Mikhail Glukhikh
7550a1870b
[FIR2IR] Make checks about f/o accessors necessity more precise
...
#KT-43342 Fixed
2020-12-01 14:23:19 +03:00
Dmitry Petrov
ee1e05fedd
KT-42151 fix type arguments in local class constructor reference types
2020-11-26 18:40:49 +03:00
Mikhail Glukhikh
1c71e64f58
[FIR] Create string interpolating call even for single argument
...
Before this commit, questionable optimization existed which
unwrapped string interpolating call with single argument to this argument.
However, this led to source element loss and the necessity of sub-hacks.
In this commit we dropped this optimization (anyway user can remove
this single-expression string template in code if needed) to keep
source elements intact.
2020-11-26 08:37:50 +03:00
Zalim Bashorov
6abd656116
[IR] dumpKotlinLike: update testdata after rebase
2020-11-26 00:15:26 +03:00
Zalim Bashorov
69f0f4ef19
[IR] update testdata: unify printing custom/non-standard modifiers
2020-11-26 00:15:21 +03:00
Zalim Bashorov
57cb8f97e9
[IR] update testdata: don't use "D" suffix on double constants
2020-11-26 00:15:18 +03:00
Zalim Bashorov
7df6575a18
[IR] update testdata: unify representation for error nodes
2020-11-26 00:15:16 +03:00
Zalim Bashorov
c68040753d
[IR] dumpKotlinLike: add testdata for FIR tests
2020-11-26 00:15:13 +03:00
Zalim Bashorov
43ee50b91d
[IR] update testdata after rebase
2020-11-26 00:15:10 +03:00
Zalim Bashorov
ad0f154ed1
[IR] add new testdata after rebase
2020-11-26 00:15:07 +03:00
Zalim Bashorov
503370c9c2
[IR] update testdata: escape special symbols in Char and String constant values
2020-11-26 00:15:04 +03:00
Zalim Bashorov
e94528fe0d
[IR] update testdata: print class name for callable references without receivers
2020-11-26 00:14:57 +03:00
Zalim Bashorov
2dbd784a6a
[IR] update testdata: print else -> ...
2020-11-26 00:14:55 +03:00
Zalim Bashorov
8f155c23a0
[IR] update testdata: better support for callable references
2020-11-26 00:14:53 +03:00
Zalim Bashorov
87eb06a21f
[IR] update testdata: improve annotations rendering in case when argument was not provided and there is default value
2020-11-26 00:14:51 +03:00
Zalim Bashorov
a34a311e86
[IR] update testdata: support annotations on parameters
2020-11-26 00:14:50 +03:00
Zalim Bashorov
5cb2572c60
[IR] update testdata: better support for enum and object accesses
2020-11-26 00:14:48 +03:00
Zalim Bashorov
4fb762e019
[IR] update testdata: minor updates for error nodes
2020-11-26 00:14:41 +03:00
Zalim Bashorov
64b42401a1
[IR] update testdata: print a parameter in catch
2020-11-26 00:14:34 +03:00
Zalim Bashorov
5c8a93c7ff
[IR] update testdata: support labels on loops, break & continue
2020-11-26 00:14:32 +03:00
Zalim Bashorov
21da2b0350
[IR] update testdata: print whole string concatenation at one line
2020-11-26 00:14:30 +03:00
Zalim Bashorov
a6b408978f
[IR] update testdata: super and receiver for field accesses
2020-11-26 00:14:28 +03:00
Zalim Bashorov
e56787c0b0
[IR] update testdata: IrInstanceInitializerCall
2020-11-26 00:14:25 +03:00
Zalim Bashorov
ab8188b032
[IR] update testdata: removed extra indentation for function expressions
2020-11-26 00:14:23 +03:00
Zalim Bashorov
5500b014f5
[IR] update testdata: better support for IrEnumConstructorCall and IrEnumEntry
2020-11-26 00:14:21 +03:00