Commit Graph

303 Commits

Author SHA1 Message Date
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 a3985bbdd3 Substitute underlying constructor when substituting type alias constructor
KT-17426 Constructor call of typealiased class gets suspicious type arguemnts
2017-04-20 10:20:36 +03:00
Dmitry Petrov 1bbbc1ca1c KT-16684 hashCode doesn't check data class property value of generic type for null 2017-03-07 11:56:52 +03:00
Dmitry Petrov 4ba8268a29 KT-16669 Exception in PSI2IR on type alias constructor in supertypes list 2017-03-07 11:56:52 +03:00
Dmitry Petrov 8c32719f3d Render 'type' for IrTypeOperatorCall expressions, update testData. 2017-03-07 11:56:52 +03:00
Dmitry Petrov e2e57e5b6d KT-16439 Generated methods of data classes have no expression for default arguments
Provide default argument expressions for generated 'copy' declaration.
2017-03-01 09:25:38 +03:00
Dmitry Petrov 0f1f354ba6 KT-16486 Strange IR for delegated members
Delegated implementations should refer to delegate field:
  $this: GET_FIELD <delegate_field> ...
    receiver: <this_for_containing_class>
2017-03-01 09:25:38 +03:00
Dmitry Petrov ee9a174c1f KT-7897 Do not require to call enum constructor for each entry if all parameters have default values
Do not report an error on enum entry without initializer if all parameters have default values
(error is still reported if there is no such constructor, or if the constructor call is ambiguous).

Record resolved call on KtEnumEntry.

NB is the enum entry has a corresponding subclass, we still have to generate the "default" constructor call,
because FE doesn't know about the platform-specific representation of that class and its constructors.

See also KT-14097, KT-15900
2017-01-24 16:59:47 +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 d9271b54fb Fix IR generation: temporary variable in 'hashCode()' for data class should be 'var' 2016-12-23 10:44:14 +03:00
Dmitry Petrov 7dce1f438f Inner classes lowering. 2016-10-19 19:13:40 +03:00
Dmitry Petrov a51efaacc9 Introduce IrGetValue as a replacement for IrThisReference / IrGetExtensionReceiver / IrGetVariable. 2016-10-18 09:09:59 +03:00
Dmitry Petrov 608d6a37d2 Some enum-related fixes
(NB: testEnumClass3 doesn't work yet, effective modality required for enum class)
2016-10-18 09:09:57 +03:00
Dmitry Petrov fc754e533d Enum classes lowering. 2016-10-18 09:09:55 +03:00
Michael Bogdanov f30027b4de Generate ir-accessors for interface properties 2016-10-18 09:09:53 +03:00
Dmitry Petrov 8551bcf103 Refactor IrWhen. 2016-10-18 09:09:38 +03:00
Dmitry Petrov 1c2a676cd6 Make coercion to Unit explicit in IR. 2016-10-18 09:09:30 +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 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 0c0dac4822 Some additional secondary constructor examples. 2016-10-18 09:09:07 +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 4eda19b36a Do not generate constructors for annotation classes. 2016-10-18 09:09:04 +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 f2e778d2d0 Some more tests. 2016-10-18 09:08:51 +03:00
Dmitry Petrov 42988383e0 Local delegated properties. 2016-10-18 09:08:50 +03:00
Dmitry Petrov e42116bb6a Delegated implementations for properties and extension properties. 2016-10-18 09:08:50 +03:00
Dmitry Petrov d27f22ae0e Delegated implementations for functions and extension functions. 2016-10-18 09:08:49 +03:00
Dmitry Petrov 2438876173 Implementing interface by delegation: creating delegates in class. 2016-10-18 09:08:49 +03:00
Dmitry Petrov 1b5dd50359 Represent class instance initialization "as from resolve". 2016-10-18 09:08:48 +03:00
Dmitry Petrov c3c758c7cc Do not generate underlying classes for enum entries without member declarations. 2016-10-18 09:08:47 +03:00
Dmitry Petrov 865d2c43c7 Default arguments stored in function declarations. 2016-10-18 09:08:46 +03:00
Dmitry Petrov 2d2100b1b5 IrSyntheticBody (for 'values', 'valueOf'). 2016-10-18 09:08:46 +03:00
Dmitry Petrov 9eeb492fe3 Underlying classes for enum entries. 2016-10-18 09:08:44 +03:00
Dmitry Petrov bd76e39a8c Enum entries generation (no underlying classes yet) 2016-10-18 09:08:44 +03:00
Dmitry Petrov 917e7bffbd Property accessors are now children of IrProperty. 2016-10-18 09:08:43 +03:00
Dmitry Petrov 1022725fd1 Data class members generation.
Builder-style API for desugaring expressions.
2016-10-18 09:08:42 +03:00
Dmitry Petrov dc169e98d5 Local classes. 2016-10-18 09:08:42 +03:00
Dmitry Petrov 41d772d636 Object literal expressions. 2016-10-18 09:08:41 +03:00
Dmitry Petrov 7adf173a66 Add tests for companion objects and various kinds of classes
(no representation for enum entries yet).
2016-10-18 09:08:39 +03:00
Dmitry Petrov a6bee7a22b Generate delegating constructor calls as IrDelegatingConstructorCall expressions
(they have different platform-level representation in JVM and JS).
2016-10-18 09:08:39 +03:00
Dmitry Petrov ba85e714e3 Generate nested initializers for class. 2016-10-18 09:08:36 +03:00
Dmitry Petrov 8528c23194 Constructors represented "as in Java".
TODO: extract nested initializers somehow.
2016-10-18 09:08:35 +03:00
Dmitry Petrov 92a7ecfac7 Render return target for IrReturn in tests.
Add tests for non-local returns from lambdas.
2016-10-18 09:08:34 +03:00