Dmitriy Novozhilov
5c29af4b53
[FIR] Tests. Update some outdated FIR testdata
2019-09-02 10:43:10 +03:00
Dmitriy Novozhilov
38fa0122e8
[FIR] Add synthetic else branch to when if it's missing
...
This change is needed for correct work of data flow, because for
non-exhaustive when there is a else branch in terms of control flow
graph.
This change leads to some errors when when is actually exhaustive, but
we still add else branch. Those errors will be gone when exhaustive
checker will be introduced
2019-09-02 10:43:05 +03:00
Mikhail Glukhikh
0962755fde
FIR2IR: drop field receiver consistency check (due to delegate field case)
2019-08-30 11:47:33 +03:00
Mikhail Glukhikh
75c4c88d0a
FIR: set receivers for invoke case more precisely
2019-08-30 11:47:32 +03:00
Mikhail Glukhikh
f0f4ddecc0
FIR: set dispatch receiver for field symbols
2019-08-30 11:47:32 +03:00
Mikhail Glukhikh
bd5e1aeef5
FIR2IR: change backing field visibility to private
2019-08-30 11:47:32 +03:00
Mikhail Glukhikh
652fd7ee73
FIR: fix dispatch receivers for objects
2019-08-30 11:47:31 +03:00
Mikhail Glukhikh
29b406c731
FIR: set dispatch receiver for backing field access
2019-08-30 11:47:31 +03:00
Mikhail Glukhikh
13d14df8ae
FIR: set dispatch receiver for data class generated functions
2019-08-30 11:47:31 +03:00
Mikhail Glukhikh
0d5cfa97a5
FIR2IR: read & set dispatch & extension receivers
...
NB: this commit includes receiver-based assertions yet failing for some tests
2019-08-30 11:47:31 +03:00
Mikhail Glukhikh
da22898a19
FIR2IR: set 'SetField' type to Unit, convert explicit 'this' references
2019-08-30 11:47:30 +03:00
Steven Schäfer
a90ac2438d
Set correct field visibility in psi2ir
2019-08-28 19:41:11 +02:00
Mads Ager
6c7a904663
Psi2Ir: Mark accessors with no bodies as default accessors.
...
They are currently marked as defined even when they get a
default implementation. That makes it hard to figure out
if the accessor should be removed when introducing a backing
field in the JVM_IR backend.
2019-08-28 19:25:13 +02:00
Mikhail Glukhikh
c9a600c5ce
FIR: handle imported members from objects more correctly
2019-08-23 17:15:08 +03:00
Mikhail Glukhikh
5d6a526eec
FIR: more accurate handling of dispatch receiver values
...
This commit fixes resolve priorities (see changed test data),
e.g. top-levels now have less priority than implicit receiver members
2019-08-23 17:15:08 +03:00
Mikhail Glukhikh
6f785ec881
FIR2IR: fix library annotation call generation
2019-08-22 18:55:10 +03:00
Mikhail Glukhikh
27ccff12c1
FIR: add resolve for delegated super-type
...
This commit fixes FIR modularized resolve test on whole Kotlin project
(without it we had empty super-type set with delegated super-types)
2019-08-22 18:53:15 +03:00
Dmitriy Novozhilov
e3e1f3c2aa
[FIR] Fix transforming value parameters of anonymous functions
2019-08-22 14:14:55 +03:00
Dmitriy Novozhilov
d841090866
[FIR] Don't analyze properties with implicit types twice
...
Test `cast.kt` now don't work absolutely correct and implicit type of
value parameter in lambda is't replaced with error type, but it's
minor bug
2019-08-22 14:14:55 +03:00
Dmitriy Novozhilov
f1e56c4b3e
[FIR] Force resolving all declaration while resolving of body with implicit type
2019-08-22 14:14:55 +03:00
Dmitriy Novozhilov
e374242adf
[FIR] Fix propagating expected type for binary operator calls
2019-08-22 10:55:07 +03:00
Dmitriy Novozhilov
ba7a137e74
[FIR] Add fir node for binary && and ||
2019-08-22 10:55:07 +03:00
Dmitriy Novozhilov
908b6ade1d
[FIR] Fix incorrect do-while loop transforming order and IR generating
2019-08-22 10:55:07 +03:00
Dmitriy Novozhilov
f877fe40b3
[FIR] Fix expected type in invoke completion
2019-08-22 10:55:07 +03:00
Dmitriy Novozhilov
57a2665b00
[FIR] Update tests for previous commit
2019-08-22 10:55:07 +03:00
Dmitriy Novozhilov
e48959350c
[FIR] Infer type of when expressions and try expressions like it is function call
2019-08-22 10:55:07 +03:00
Dmitriy Novozhilov
637fb55a7b
[FIR] Add implementation of intersection types to Fir type system
2019-08-22 10:55:07 +03:00
Dmitriy Novozhilov
e6bf3b3263
[FIR] Render nullability in type renderer, not in fir renderer
2019-08-22 10:55:07 +03:00
Dmitriy Novozhilov
6e2958880b
[FIR] Add forgotten replacing arguments in abbreviated type expansion
2019-08-22 10:55:07 +03:00
Dmitry Petrov
986654b709
psi2ir: fix unsubstituted type parameters around SAM conversions
...
Preserve type substitution:
- when obtaining function type for SAM type;
- when generating SAM conversions for SAM adapter arguments;
- for "original" method corresponding to a SAM adapter.
2019-08-14 14:18:42 +03:00
Dmitry Petrov
7170439517
IR: '!!' is generated as 'CHECK_NOT_NULL' intrinsic
...
```
fun <T : Any> CHECK_NOT_NULL(x: T?): x =
if (x != null) x else throw NullPointerException(...)
```
This allows to compile both Kotlin/JVM and Kotlin/JS effectively.
2019-08-14 11:16:10 +03:00
Dmitry Petrov
1d0ba4edd4
IR: IrTypeAlias: update testData after rebase on master
2019-08-06 12:42:44 +03:00
Dmitry Petrov
6abb0ffe28
IR: IrTypeAlias: Update FIR2IR testData
...
NB a lot of FIR2IR tests actually don't pass, and we don't care much at
the moment.
2019-08-06 12:42:02 +03:00
Dmitry Petrov
48ae76ac28
IR: Introduce IrTypeAlias element
2019-08-06 12:42:02 +03:00
Dmitry Petrov
bdec8b04e8
Minor: trim in RenderIrElementVisitor
2019-07-31 10:37:35 +03:00
Mikhail Glukhikh
d32e5065c5
FIR: implementation of delegateProvider in delegate resolve
2019-07-25 09:46:42 +03:00
Mikhail Glukhikh
213f951da3
FIR: partial implementation of delegate resolve #KT-32217 Fixed
2019-07-25 09:46:34 +03:00
Mikhail Glukhikh
63b7fa70f9
FIR2IR: add extension receiver parameters to functions
2019-07-25 09:46:29 +03:00
Dmitry Petrov
127be9be03
psi2ir: Fix KT-30796 ErrorType for '?:' in OI
2019-07-22 09:46:21 +03:00
Dmitry Petrov
ffd9b45ef3
IrFunctionExpression: add 'origin'
...
This is actually either a LAMBDA or an ANONYMOUS_FUNCTION.
Not quite sure if it's really required, but some tools such as IR-based
decompiler might require this information.
2019-07-19 11:36:19 +03:00
Dmitry Petrov
41b59f9b9a
IrFunctionExpression: update fir2ir tests
2019-07-19 11:36:19 +03:00
Dmitry Petrov
ed2b4a8bec
Introduce IrFunctionExpression IR element
...
Use it to represent proper function expressions (lambdas and anonymous
functions).
2019-07-19 11:36:18 +03:00
Mikhail Glukhikh
7ccf21c5c8
FIR resolve: fix vararg parameter types
2019-07-17 10:45:07 +03:00
Mikhail Glukhikh
592cf4f4e8
Make FirNamedReferenceWithCandidate not resolved, fix receiver completion
...
Counting it as resolved provokes a lot of difficult to discover errors
2019-07-17 10:45:06 +03:00
Simon Ogorodnik
1222449dc8
FIR resolve: perform inference completion for property access
2019-07-17 10:45:06 +03:00
Mikhail Glukhikh
2d74dac4f2
FIR: set constructor parameter scope correctly for designated transformer
2019-07-17 10:45:05 +03:00
Dmitry Petrov
6963424dfc
psi2ir: Empty 'if' branches have type 'kotlin.Unit'
2019-07-15 08:58:04 +03:00
Dmitry Petrov
6ea33986fa
psi2ir: Provide substituted descriptor for property references
2019-07-11 15:32:43 +03:00
Mikhail Glukhikh
43c6049f02
FIR2IR: set origin correctly for synthetic property accesses
2019-07-11 12:46:48 +03:00
Mikhail Glukhikh
c6a09dba4e
FIR: consider Java default constructors as primary ones
2019-07-11 12:40:29 +03:00