Commit Graph

280 Commits

Author SHA1 Message Date
Mikhael Bogdanov 1a1bb53381 Update IR text test
Additional implicit coercions to unit was added
2018-08-15 14:18:15 +03:00
Dmitry Petrov 56ad091534 Generate synthetic inline class methods in psi2ir 2018-08-14 10:00:21 +03:00
Dmitry Petrov de11d9164d Add IrClass.irInline 2018-08-14 10:00:21 +03:00
Dmitry Petrov 1bfb75a51b Generate intrinsic-based numeric comparison only for FP types 2018-08-03 09:34:59 +03:00
Dmitry Petrov ea710ce607 IrField.isStatic: Update testData for new test 2018-07-31 14:04:04 +03:00
Dmitry Petrov 6dfcf15a39 IR: IrField.isStatic 2018-07-31 13:39:54 +03:00
Mikhail Zarechenskiy acd5b62148 Introduce limited constant conversions for Kotlin/Native
#KT-25320 Fixed
2018-07-29 04:32:32 +03:00
Dmitry Petrov 65fe1101fd Object references in object field initializers are 'GET_VAR this@Object' 2018-07-23 18:16:32 +03:00
Dmitry Petrov ae0704af9c Generate singleton references as GET_OBJECT in nested classes 2018-07-20 16:46:18 +03:00
Dmitry Petrov 779cae7db5 Adjust receivers for possibly synthetic properties access
Synthetic property accessors are treated as extension functions on Java
classes by the front-end. However, underlying Java accessor methods are
proper members.
2018-07-20 16:46:18 +03:00
Dmitry Petrov 99a71b9ecc Desugar synthetic Java properties in psi2ir 2018-07-19 12:34:45 +03:00
Dmitry Petrov 76bfb94538 Add tests for Java synthetic properties in external dependencies 2018-07-19 12:34:45 +03:00
Svyatoslav Scherbina 226f16b44e ir.tree: fix .originalKotlinType for transformed IR types 2018-07-03 09:55:12 +03:00
Ilya Gorbunov 16fb5f6901 Set language and api versions automatically for unsigned types box tests
Remove InlineClasses feature directive from tests
2018-07-03 03:52:18 +03:00
Dmitry Petrov bbcb12ea4b samAdapter test doesn't actually need FULL_JDK 2018-06-29 14:27:57 +03:00
Dmitry Petrov b1d0a5e807 Fix delegated function body generation 2018-06-29 11:24:46 +03:00
Dmitry Petrov 799fcc2606 Fix IrType rendering, update testData 2018-06-29 11:24:46 +03:00
Dmitry Petrov 8999e5bfe6 psi2ir: support unsigned integer literals
NB in FE unsigned integer constants are now represented using signed
integer types (e.g., UInt constant actually holds an Int value).
So, in IR so far we also represent unsigned constant literals as
constant values of corresponding signed types, but with corresponding
unsigned type:
0xFFFF_FFFFu becomes 'CONST Int type=kotlin.UInt value=-1'
2018-06-21 12:32:00 +03:00
Mikhael Bogdanov c588d22e6a Don't sort descriptors in DeclarationStubGenerator
Sorting adds 30% time to test execution
2018-06-21 11:18:35 +02:00
Dmitry Petrov bf083314dd Support 'when' with subject variable in psi2ir 2018-06-20 14:06:34 +03:00
Dmitry Petrov ecd2709a11 psi2ir: type arguments for function references 2018-06-19 11:13:50 +03:00
Roman Artemev 960fba3c4e Fix test failures 2018-06-15 16:23:06 +03:00
Dmitry Petrov 7b1b557250 psi2ir: Java annotations have no primary constructor 2018-05-31 10:09:31 +03:00
Dmitry Petrov 8094cb7dc5 psi2ir: Generate external dependencies in a loop
There are some cases (superclasses, overridden methods, and so on) where
external dependencies generation can require additional external
dependencies.
2018-05-31 10:09:31 +03:00
Dmitry Petrov 7a2bb79777 psi2ir: Use substituted 'hashCopy' for generated data class 'hashCopy' 2018-05-30 12:02:34 +03:00
Dmitry Petrov cb301763f3 psi2ir: Fix implicit casts generation
Implicit cast from T to S is not required if
  T <: S.makeNullable()
2018-05-30 12:02:34 +03:00
Dmitry Petrov ab455d6572 IR: IrSimpleFunction.correspondingProperty: IrProperty?
Non-null for a property accessor, points to a corresponding property.
2018-05-25 09:40:51 +03:00
Dmitry Petrov 8dbfd85d26 psi2ir: Support class literals in annotations 2018-05-22 15:29:01 +03:00
Ilya Gorbunov 15d21a0532 Remove UnsafeVariance from expected testdata for serialized builtins tests
UnsafeVariance source annotation is no longer serialized as a result of KT-23360
2018-05-16 17:37:02 +03:00
Dmitry Petrov 21dfee4565 psi2ir: inferred type for 'when' is Nothing only if it's exhaustive
TODO: fix inference bug
2018-05-15 15:43:56 +03:00
Dmitry Petrov 0feb50021c IrClass.isInner 2018-05-14 10:37:27 +03:00
Dmitry Petrov 93f5fe2451 IrField is 'final' if corresponding property is 'val' 2018-05-11 11:24:46 +03:00
Dmitry Petrov 729efaf912 IR: IrConstructor.isPrimary
NB this is required for Kotlin/JS.
2018-05-11 11:24:46 +03:00
Dmitry Petrov a6057fb499 IR: {IrClass, IrFunction, IrProperty, IrField}.isExternal 2018-05-11 11:24:46 +03:00
Dmitry Petrov 9717345e3b IR: IrField.isFinal 2018-05-11 11:24:46 +03:00
Dmitry Petrov e6baf0296d More annotation generation for declarations with test cases 2018-04-09 11:24:37 +03:00
Dmitry Petrov 57077a5eb8 Generate annotations for declarations in psi2ir 2018-04-09 11:24:37 +03:00
Dmitry Petrov 4016254fd4 Generate constructors with empty bodies for annotation classes
Default parameter values of primary constructor of an annotation class
are required to generate default values of annotation properties.
2018-04-09 11:24:37 +03:00
Dmitry Petrov 3b967017f6 Render type arguments by index 2018-03-27 17:25:11 +03:00
Dmitry Petrov bd7e9d5397 Fix type argument mapping for members imported from objects 2018-03-23 11:43:44 +03:00
Dmitry Petrov 135d3ab57a Fix type arguments mapping 2018-03-23 11:43:44 +03:00
Dmitry Petrov eb5904ea8e Underlying constructor for type alias should always be substituted
Otherwise PSI2IR fails because of type mismatch.
2018-03-23 11:43:44 +03:00
Svyatoslav Scherbina f3bc8d179c Add one more IR text test case 2018-03-16 14:47:20 +03:00
Svyatoslav Scherbina aac940415f Fix psi2ir when type parameter bound goes after the type parameter 2018-03-16 14:47:18 +03:00
Svyatoslav Scherbina d3ab86db48 Fix access to scoped symbol table when inserting implicit casts to IR 2018-03-13 09:46:32 +03:00
Svyatoslav Scherbina 7a2d761a7d Add minor improvements to psi2ir and IR utilities:
* Generate missing IR parameter declarations in external stubs
* Use origin = FAKE_OVERRIDE in external IR stubs for fake overrides
* Set .parent in external IR stubs
* Set .parent in IR generated by some utility methods
2018-03-02 15:41:48 +03:00
Dmitry Petrov 13a7270129 Generate type parameter declarations for property accessors
This requires "scoped" type parameter symbols, because in the ugly world
of descriptors property accessors have no type parameters of their own.
2018-03-02 14:35:35 +03:00
Dmitry Petrov ae7f60a96e Update IR testData after rebase on master 2018-02-28 10:35:13 +03:00
Dmitry Petrov b206bf199f Add type operand symbol for type operator expression 2018-02-28 10:35:13 +03:00
Dmitry Petrov e89047d2cc Generate super classes and overridden functions in proper scope
Such references require proper scope so that local symbols are bound.
Example:

```
fun <T> outer() {
    abstract class ALocal<S : T> {
        abstract fun bar()
    }

    class Local<S : T> : ALocal<S>() {
        override fun bar() {}
    }
}
```

Here local classes have type parameters with upper bounds depending on
function type parameters, and members overriding members in other local
classes.
2018-02-28 10:35:13 +03:00