Commit Graph

45 Commits

Author SHA1 Message Date
Dmitry Petrov bd5b984da9 Return type of local delegated property setter should be Unit
#KT-17950 Fixed
2017-05-22 11:47:09 +03:00
Dmitry Petrov f5fde2c24f Dump absent type arguments 2017-05-05 09:59:30 +03:00
Dmitry Petrov ddb2b7508b Generate property initializer within property scope 2017-05-05 09:59:30 +03:00
Dmitry Petrov 8e84862afa Generate do-while condition within loop body scope 2017-05-05 09:59:30 +03:00
Dmitry Petrov c4346f95ff Minor: fix testData format local delegated properties with 'suspend' 2017-05-04 09:33:03 +03:00
Dmitry Petrov 78a601af87 Generate parameter declarations for fake overrides 2017-05-04 09:33:03 +03:00
Dmitry Petrov fa4dc26814 Put 'thisReceiver' declaration in class
Interfaces also have 'thisReceiver'
2017-05-04 09:33:03 +03:00
Dmitry Petrov a511540aad Render receivers as 'this@owner: type'
Add test for generic inner class with generic outer class.
2017-05-04 09:33:03 +03:00
Dmitry Petrov 1bf6f8fc57 Do not generate separate type parameter declarations for constructors 2017-05-04 09:33:03 +03:00
Dmitry Petrov d7a362b4f6 Binding: all current tests are green. 2017-05-04 09:33:03 +03:00
Dmitry Petrov 2b48908586 Local delegated properties implementation + some more fixes 2017-05-04 09:33:03 +03:00
Dmitry Petrov c9777fd79f Add symbols to references
TODO: fix some more tests
2017-05-04 09:33:03 +03:00
Dmitry Petrov a416cddcb2 Generate declarations for FAKE_OVERRIDE members 2017-05-04 09:33:03 +03:00
Dmitry Petrov 8cea27b5bb Generate IrTypeParameter and IrValueParameter declarations 2017-05-04 09:33:03 +03:00
Dmitry Petrov 6cefc0ddf3 Infer suspend flag for local delegated property accessors
Local delegated property accessors calling suspend operators getValue
or setValue should be suspend functions themselves.

KT-17605 Getter and setter of suspend delegated property are not suspend
2017-05-02 12:52:36 +03:00
Igor Chevdar 10ea2883f7 Supported KProperty2 and KMutableProperty2 for delegated properties
Consider this code:
object Delegate {
    operator fun getValue(t: Any?, p: KProperty<*>): String {
        return ""
    }
}

class A {
    val String.ext by Delegate
}

then the type of <p> is KProperty2 (it has 2 receivers).

Test fix + review fixes
2017-03-15 12:20:57 +03:00
Dmitry Petrov 8c32719f3d Render 'type' for IrTypeOperatorCall expressions, update testData. 2017-03-07 11:56:52 +03:00
Dmitry Petrov c226707a80 KT-16554 Local function with default arguments have no IR elements for them 2017-03-02 14:25:58 +03:00
Dmitry Petrov 885f397cdd KT-16535 'provideDelegate' convention is not supported in IR
Implement provideDelegate convention support.
NB delegate type now depends on 'provideDelegate' convention resolution.
2017-03-01 09:25:38 +03:00
Dmitry Petrov de14d4abc8 KT-15748 Type alias constructor return type should have a corresponding abbreviation 2017-01-27 15:16:04 +03:00
Ilya Gorbunov dcd7f3eb57 Fix test data after introducing overloads #KT-15630 2017-01-11 14:33:17 +03:00
Svyatoslav Scherbina 4c3fb9a21f psi2ir: improve backing field usage generation
Also update corresponding tests data.
2017-01-11 14:54:10 +07:00
Dmitry Petrov 4c47d77a9f Report error on non-top-level type aliases (unsupported in 1.1).
Get rid of nested type aliases in project.
2016-11-21 10:25:51 +03:00
Dmitry Petrov a51efaacc9 Introduce IrGetValue as a replacement for IrThisReference / IrGetExtensionReceiver / IrGetVariable. 2016-10-18 09:09:59 +03:00
Michael Bogdanov f30027b4de Generate ir-accessors for interface properties 2016-10-18 09:09:53 +03:00
Dmitry Petrov 1c2a676cd6 Make coercion to Unit explicit in IR. 2016-10-18 09:09:30 +03:00
Dmitry Petrov 7ae6c55ddb IrMemberAccessExpression::getTypeArgument 2016-10-18 09:09:28 +03:00
Dmitry Petrov 4b9c5effd3 Minor: irElement rendering 2016-10-18 09:09:25 +03:00
Dmitry Petrov a8a6477ce5 IrOperator -> IrStatementOrigin 2016-10-18 09:09:21 +03:00
Dmitry Petrov c699e2d24c Include declaration origin in testData. 2016-10-18 09:09:19 +03:00
Dmitry Petrov 1a3dedaf1c Minor: add test for primary constructor default parameter values. 2016-10-18 09:09:16 +03:00
Dmitry Petrov 201d2414bc Properties declared in primary constructors should have proper accessors in IR. 2016-10-18 09:09:15 +03:00
Dmitry Petrov 5c720845a8 Drop IrPropertyAccessor (and subclasses).
Drop IrLocalPropertyAccessor (and subclasses).
Introduce IrField.
2016-10-18 09:09:15 +03:00
Dmitry Petrov 4e270ef487 Store file-level annotations in IrFile (should be on some descriptor, really). 2016-10-18 09:09:09 +03:00
Dmitry Petrov 8fc16345e6 Property initializers from primary constructor parameters
are generated as property initializer expressions
and should not be repeated in primary constructor.
2016-10-18 09:09:06 +03:00
Dmitry Petrov 4e112b3f88 testData format update: detailed descriptor rendering. 2016-10-18 09:09:04 +03:00
Dmitry Petrov ceeccfa1b7 Properties without accessors are generated as
IrGetBackingField / IrSetBackingField expressions.
2016-10-18 09:09:01 +03:00
Dmitry Petrov 539d7ccf6f Support configuration directives FULL_JDK, WITH_RUNTIME, WITH_REFLECT in Psi2Ir tests. 2016-10-18 09:08:59 +03:00
Dmitry Petrov 28b3ea27f3 Generate explicit call to 'Any()' if no superclass found.
Generate call super-constructor calls as IrDelegatedConstructorCall.
2016-10-18 09:08:57 +03:00
Dmitry Petrov a3dadd9e3f Callable references now can have receivers and arguments
(for bound references implementation).
2016-10-18 09:08:53 +03:00
Dmitry Petrov 8b95992af1 Generate get/set for local delegated properties as accessor calls. 2016-10-18 09:08:51 +03:00
Dmitry Petrov 42988383e0 Local delegated properties. 2016-10-18 09:08:50 +03:00
Dmitry Petrov 264c8afc78 Type aliases. 2016-10-18 09:08:48 +03:00
Dmitry Petrov 1b5dd50359 Represent class instance initialization "as from resolve". 2016-10-18 09:08:48 +03:00
Dmitry Petrov 759f0168c2 Delegated properties. 2016-10-18 09:08:47 +03:00