Mikhail Glukhikh
3576cbf0d8
[FIR] Add test for KT-42805
2020-10-22 13:04:59 +03:00
Mikhail Glukhikh
f2c651ec9c
[FIR2IR] Don't generate Any delegated members for data class
...
#KT-42771 Fixed
2020-10-22 13:04:59 +03:00
Mikhail Glukhikh
44459e8ac7
FIR mangler: fix alias-based type handling #KT-42770 Fixed
2020-10-22 13:04:58 +03:00
Jinseong Jeon
46cc01602e
FIR2IR: add implicit NOT_NULL cast if needed
2020-10-22 10:51:20 +03:00
Dmitry Petrov
b1b87becc8
PSI2IR more JVM-like exhaustive when behavior KT-36840
2020-10-21 20:07:11 +03:00
pyos
95fb597da0
PSI2IR / FIR2IR: bind FunctionN as receiver when suspend-converting
...
This is more consistent with adapted references & allows skipping a
temporary variable.
2020-10-21 15:21:01 +02:00
pyos
ccf921510d
PSI2IR / FIR2IR: do not create temporaries for adapted references
...
Arguments to function references behave the same as arguments to
function calls and should be evaluated once regardless, so the temporary
is unnecessary.
2020-10-21 15:21:01 +02:00
Dmitry Petrov
0b34526321
JVM_IR remove lambda hack required for odd JVM+OI behavior in KT-35849
2020-10-21 13:47:01 +03:00
Dmitriy Novozhilov
bf1a00c73a
[FIR] Rework resolution of declaration statuses
...
There is introduced algorithm of resolution with jumps: before
resolution of some class we resolve all status of members of its
supertypes, so we can properly determine inherited visibility
and modifiers
2020-10-21 11:53:10 +03:00
Dmitry Petrov
3979cde738
Add box and PSI2IR tests for special cases listed in KT-35849
2020-10-20 19:31:40 +03:00
Dmitry Petrov
47c784f023
JVM_IR fix Java wildcard types translation
...
Types such as 'Collection<? extends CharSequence>' are treated as
'(kotlin.collections.MutableCollection<out kotlin.CharSequence!>
..kotlin.collections.Collection<kotlin.CharSequence!>?)'
by the front-end.
When generating generic signatures, JVM BE takes lower bound (which is
'kotlin.collections.MutableCollection<out kotlin.CharSequence!>').
Emulate this behavior in TypeTranslator.
2020-10-19 20:52:53 +03:00
Jinseong Jeon
5f64d6ec76
FIR2IR: add support for callable reference to Java field
...
#KT-42656 Fixed
2020-10-15 08:47:46 +03:00
Alexander Udalov
45a0850d95
Fix KotlinType.isNullabilityFlexible for types based on type parameters
...
In the compiler, this function was used in psi2ir (and it affected
nullability annotations in the resulting JVM class files), in "useless
elvis with null on the right side" diagnostic checker, and in light
classes.
#KT-42650 Fixed
2020-10-14 19:32:51 +02:00
Mikhail Glukhikh
babc7845af
FirSyntheticPropertiesScope: support case with derived getter
...
#KT-42496 Fixed
2020-10-14 16:33:44 +03:00
Mikhail Glukhikh
2f9b7495fc
[FIR2IR] Make safe call result always nullable
2020-10-14 16:33:37 +03:00
Jinseong Jeon
bc6693fa6e
FIR2IR: element-wise SAM conversion for vararg
2020-10-13 15:40:06 +03:00
Steven Schäfer
f20a695c0e
Minor: Rebase testGenericConstructorCallWithTypeArguments
2020-10-12 17:34:34 +02:00
Jinseong Jeon
8c88670185
FIR: copy constructor for typealias'ed inner/nested class
2020-10-08 16:33:13 +03:00
Mikhail Glukhikh
beac3757bc
[IR text test] Minor: add forgotten .fir.txt file
2020-10-08 10:33:58 +03:00
Mikhail Glukhikh
aa4a042612
[FIR2IR] Use deepest matching symbol also for synthetic properties
...
#KT-42359 Fixed
2020-10-07 10:43:43 +03:00
Mikhail Glukhikh
fb4f27e136
[FIR2IR] Add test for problematic KT-42359
2020-10-07 10:43:38 +03:00
Dmitry Petrov
b1bd138afb
JVM_IR fix inline class <-> collection stubs issues
...
Move collectionStubMethodLowering before jvmInlineClassPhase, and make
them interact properly.
Note that some issues still remain in inline class <-> special bridges
interaction.
KT-40187 KT-42469
2020-10-06 17:08:24 +03:00
Mikhail Glukhikh
3cd552cb43
[FIR2IR] Process anonymous object nested classes correctly
...
#KT-42373 Fixed
2020-10-05 12:06:53 +03:00
Mark Punzalan
a2a4d94834
[FIR] Capture array and indices for postfix/prefix increment/decrement
...
of array element (including overloaded indexed access operators, e.g.,
`a[b, c]++`).
This prevents double-evaluation of the array and indices expressions,
which may have side-effects.
2020-10-02 12:08:03 +03:00
Mark Punzalan
eb631bc429
[FIR] Keep vararg argument order in resolved calls (KT-17691).
2020-10-02 12:08:02 +03:00
Mark Punzalan
f6ce2d893c
[FIR] Handle varargs in overloaded indexed access operator.
2020-10-02 12:08:01 +03:00
Mikhail Glukhikh
582f8fe287
FIR: recursive transform annotation if it has annotation as argument
...
#KT-42344 Fixed
2020-10-02 08:57:49 +03:00
Mikhail Glukhikh
2fd752f8f6
IR interpreter: fix calculation of constant Java fields
...
#KT-42117 Fixed
2020-10-02 08:57:44 +03:00
Denis Zharkov
5c9187b270
FIR2IR: Rework fake overrides generation
...
- To discriminate what's already been generated, use the set of declaration
instead of names (it's obviously more correct)
- Make it possible to set more then one overridden (base)
2020-10-01 17:49:02 +03:00
Denis Zharkov
b241161c35
FIR2IR: Rework DelegatedMemberGenerator
...
Use scope content instead of manual traversing of declarations
2020-10-01 17:49:02 +03:00
Dmitriy Novozhilov
4ef57c120f
[FIR] Consider variance of type parameters during java type enhancement
...
#KT-41940 Fixed
2020-09-24 15:43:20 +03:00
Jinseong Jeon
5b136516c4
FIR: utilize checking subtype of functional type and finding invoke symbol
2020-09-24 14:05:52 +03:00
Dmitriy Novozhilov
10e7c0f1b2
[TEST] Fix long literal in testdata broken in 4374c06
2020-09-23 15:22:03 +03:00
Dmitriy Novozhilov
40a9bb6eac
[FIR] Assume nullable types as good types for ILT approximation
...
#KT-41982 Fixed
2020-09-23 14:05:10 +03:00
Dmitriy Novozhilov
4374c06537
[FIR] Approximate all integer literals which resolved in independent mode
...
#KT-42016
2020-09-23 14:05:10 +03:00
Dmitriy Novozhilov
5efd533f55
[FIR] Desugar unary plus and minus as part of integer literal
...
#KT-42016
2020-09-23 14:05:09 +03:00
Mikhail Glukhikh
4653a16450
[FIR2IR] Add problematic test with in/out clash during approximation
2020-09-23 09:01:45 +03:00
Mikhail Glukhikh
b64b32e06b
FIR: keep captured types in substitution scope
2020-09-23 09:00:57 +03:00
Mark Punzalan
f55ff8eb1b
[FIR] Capture receiver for pre/postfix dec/increment of qualified access
...
This prevents double-evaluation of the receiver expression, which may
have side-effects. E.g.: a.b++
2020-09-22 10:20:46 +03:00
Jinseong Jeon
72dea05854
FIR2IR: approximate type argument if reified
2020-09-17 09:43:46 +03:00
Mikhail Glukhikh
e1b4108e4a
[FIR2IR] Mute some tests due to captured type problems
2020-09-14 18:08:30 +03:00
Mikhail Glukhikh
e4aaae9ae7
FIR call completion: approximate type argument types
...
This commit removes some captured / ILT types at the end of resolve
2020-09-14 18:08:28 +03:00
Mikhail Glukhikh
cf5480a398
[FIR] Questionable test data fixes (around captured types)
2020-09-14 18:08:26 +03:00
Mikhail Glukhikh
414842343d
[FIR2IR] Add another problematic test with captured type argument
2020-09-14 17:56:32 +03:00
Mikhail Glukhikh
267382d86b
[FIR2IR] Add problematic test with incorrect type argument
...
NB: we should not have <E> as AbstractFirBasedSymbol type argument,
because it isn't accessible in the current scope. Star expected instead.
2020-09-14 17:56:30 +03:00
Jinseong Jeon
680dd64211
FIR2IR: pick return target based on matched IrFunction
2020-09-14 10:09:51 +03:00
Jinseong Jeon
6ebad9589a
FIR2IR: set proper IR origin for iterator in ranges
2020-09-14 10:09:45 +03:00
Mikhail Glukhikh
578e707ab9
FIR2IR: set VARIABLE_AS_FUNCTION origin only for invoke receivers
2020-09-14 10:09:32 +03:00
Jinseong Jeon
89ffce22d8
FIR2IR: set proper IR origin for variable as function
2020-09-14 09:05:08 +03:00
Dmitriy Novozhilov
7f692be11e
[FIR] Properly detect callable reference type according conversions
2020-09-11 12:13:33 +03:00