Roman Artemev
b010d9eef8
Add Contract tests for JS
2018-11-08 17:35:06 +03:00
Dmitry Petrov
1523185734
KT-27948: Use proper KotlinType when comparing with literal 0
...
#KT-27948
2018-11-07 18:17:29 +03:00
Dmitry Petrov
e14f74bc18
KT-27948: Properly coerce values when generating areEqual call
...
#KT-27948
2018-11-07 18:17:29 +03:00
Dmitry Petrov
ac7cc0c08e
KT-27706: Dispatch receiver type for constructor accessor is Object
2018-11-07 18:17:29 +03:00
Dmitry Petrov
ea4afdaebe
KT-27705: Use proper types for captured outer class instance
...
Call typeMapper only if we have an inline class.
2018-11-07 18:17:29 +03:00
Mikhael Bogdanov
d2a205c72d
Update synthetic parameter processing logic according to ASM 7 changes
...
#KT-27774 Fixed
2018-11-07 15:42:57 +01:00
Roman Artemev
7f215d3f52
Update tests
2018-11-01 16:51:38 +03:00
Alexander Udalov
c5275f178a
Do not use getMethod/getConstructor in reflection
...
Use only getDeclaredMethod/getDeclaredConstructor instead. The reason is
that getMethod/getConstructor only finds public-API (public or protected
on JVM) declarations, and to determine if a declaration is public-API in
the class file we used isPublicInBytecode, which was trying to load
annotations on the declaration to see if it was InlineOnly, and that
required lots of time-consuming actions and worsened the stack trace (as
can be seen e.g. in KT-27878). In fact, the implementation of
Class.getMethod is not supposed to do anything complicated except
loading annotations from each superclass and superinterface of the given
class. Doing it in our codebase simplifies implementation and probably
improves performance
2018-10-31 17:21:06 +01:00
Alexander Udalov
2f72f68e1a
Fix loading class literal value void.class in reflection
...
#KT-27878 Fixed
2018-10-31 17:21:05 +01:00
Roman Artemev
59b1743c37
Add tests
2018-10-25 15:48:42 +03:00
Alexander Udalov
9394caf9cf
Use access to backing field on overridden property with private setter
...
#KT-27772 Fixed
2018-10-24 12:53:50 +02:00
Mikhael Bogdanov
edc648813d
Regenerate box tests
2018-10-22 16:32:52 +02:00
Georgy Bronnikov
605afbae90
Move fields and init blocks of companions to their owners
2018-10-17 21:15:28 +03:00
Dmitry Petrov
b13d270d77
Test: reference to constructor with inline class parameters
2018-10-17 16:38:22 +03:00
Dmitry Petrov
0af2a0dc19
Tests: references to private/internal primary val of inline class
2018-10-17 16:38:22 +03:00
Dmitry Petrov
5032c106af
Support 'call' for references to inline class constructors
...
#KT-26748
2018-10-17 16:38:22 +03:00
Dmitry Petrov
94e1701089
Support 'call' for references to inline class members
...
This includes overriding and non-overriding functions and properties.
#KT-26748
2018-10-17 16:38:22 +03:00
Dmitry Petrov
3dc4d01adc
Tests for callable references and inline classes
2018-10-17 16:38:22 +03:00
romanart
71f109387a
Update tests
2018-10-17 14:10:37 +03:00
Georgy Bronnikov
376eef05f5
JVM_IR. Accessor lowering
2018-10-15 21:52:50 +03:00
Dmitry Petrov
b6be72bb11
Add more tests for inline classes
...
#KT-27416
#KT-27513
2018-10-15 12:21:14 +03:00
Dmitry Petrov
0fd68d29f4
Support @JvmStatic in inline class companion object
...
#KT-27107
2018-10-15 12:21:14 +03:00
Dmitry Petrov
5304754e88
Generate specialized 'toString' for inline classes when possible
...
#KT-25613
2018-10-15 12:21:14 +03:00
Dmitry Petrov
f68ce4b35b
Support default parameter values for inline class constructors and funs
...
#KT-26908
#KT-26554
Move default parameter value tests to separate directory
2018-10-15 12:21:14 +03:00
Dmitry Petrov
8ce1d09f8a
Fix inline class coercion in default parameter values
...
#KT-27358
2018-10-15 12:21:14 +03:00
Mikhail Zarechenskiy
b7d7d1eb01
Fix inline class type coercion in == with generic call
...
#KT-27393 Fixed
2018-10-12 12:50:49 +03:00
Mikhail Zarechenskiy
0201694f84
Propagate KotlinType into create method for coroutines
...
#KT-27526 Fixed
2018-10-12 12:50:47 +03:00
Mikhail Zarechenskiy
a8abd8cceb
Fix boxing/unboxing for generic functions on index expressions
...
Unsubstituted type should be used for coercion to box value of
inline class type if it's needed. For the substituted value it's not
known if it was a generic parameter or not.
#KT-27502 Fixed
2018-10-12 11:58:56 +03:00
Anton Bannykh
44d56cb278
JS: fix val with backing field initialization in secondary constructors
...
This change reverts the AssignmentTranslator logic to a previous state
of "if we assign to a val, tranlate to backing field". Previously a
check whether or not we are inside of a constructor was added. The
check didn't detect secondary constructors, hence initializing of
val's with backing field started to work incorrectly.
The check itself was added in an attempt to prevent augmented assignment
operators to reference the backing field. The check seems to have been
wrong, because an augmented assignment could happen inside a construcotr.
A more correct fix was added later. It seems that it is safe now to
revert the logic back and rely on the frontend to only allow assignment
to a val property during initilization.
2018-10-10 17:25:55 +03:00
Dmitry Petrov
b55b0c1ff1
Support local property delegation to inline class values
...
Also, add extra test on property delegation.
2018-10-03 11:09:48 +03:00
Dmitry Petrov
6fa436911a
Support interface delegation to inline class values (KT-27318)
2018-10-03 11:09:47 +03:00
Dmitry Petrov
5480bf69e8
Support property delegation to inline class values (KT-27070)
2018-10-03 11:09:46 +03:00
Dmitry Petrov
70e60ea9bc
Fix inline class coercion in string template with StringBuilder.append
...
Inline class values with array as a carrier type were not boxed.
#KT-27113
2018-10-03 11:09:41 +03:00
Dmitry Petrov
7b7cf39388
Fix inline classes coercion in 'if' expression
...
#KT-27132
2018-09-28 10:46:42 +03:00
Dmitry Petrov
ab90b2b901
Fix nullability propagation in inline class type mapping
...
#KT-27096
See https://jetbrains.slack.com/archives/C06E082M6/p1537949572000100
2018-09-28 10:46:42 +03:00
Dmitry Petrov
0b23ddb947
Add test for KT-27140
2018-09-28 10:46:42 +03:00
Dmitry Petrov
7624dbbb20
Fix subject variable handling in specialized enum codegen
...
#KT-27161
2018-09-27 10:48:35 +03:00
Dmitry Petrov
0dd04c3424
Postpone companion object field visibility
...
Have to reconsider this issue because of interface companion objects.
2018-09-27 10:35:23 +03:00
Dmitry Petrov
792ff3c39e
Generate private interface companion object as package-private synthetic
2018-09-27 10:35:23 +03:00
Dmitry Petrov
7949ac1080
Use common instance receiver generation logic for 'this' expression
...
Otherwise it would skip private companion object accessor generation.
2018-09-27 10:35:23 +03:00
Dmitry Petrov
ba32ed7404
Test: @JvmField in inline class companion
2018-09-25 11:15:29 +03:00
Dmitry Petrov
bffe9e45e8
Add accessor tests: inline class <-> companion
...
KT-26858 was fixed somewhere in the middle.
#KT26858
2018-09-25 11:15:29 +03:00
Dmitry Petrov
850d72f13f
Fix accessor generation for inline class members
...
TODO 'generateMethodCallTo' is a bloody mess that deserves rewriting.
2018-09-25 11:15:29 +03:00
Dmitry Petrov
edc8cf3ed0
Use proper type for context 'this'
...
Bug in 'generateThisOrOuterFromContext', it worked while instance of a
class was always an object.
#KT-27078
2018-09-25 11:15:29 +03:00
Dmitry Petrov
c1bb3479df
More tests on casts on receiver of inline class type
2018-09-25 11:15:29 +03:00
Dmitry Petrov
88cc900dc7
Add test for private inline class method call from inline lambda
2018-09-25 11:15:29 +03:00
Dmitry Petrov
2e6d53a43f
Fix extension receiver coercion for inline classes
...
#KT-27031
2018-09-25 11:15:29 +03:00
Dmitry Petrov
20d7210239
Fix outer class mapping for closures in inline class
...
#KT-27030
#KT-27033
2018-09-25 11:15:29 +03:00
Dmitry Petrov
26602c8443
Minor: move tests
2018-09-25 11:15:29 +03:00
Dmitry Petrov
f9a419f940
Fix companion method access from inline class
...
#KT-27025
2018-09-25 11:15:29 +03:00