Commit Graph

96 Commits

Author SHA1 Message Date
Mikhael Bogdanov
ca5b19d0c6 Merge Java 8 write signature tests in common ones 2018-08-27 15:55:03 +02:00
Alexander Udalov
1c2a9e4b21 Map annotation target TYPE -> TYPE_USE if JVM target >= 1.8
And TYPE_PARAMETER -> TYPE_PARAMETER similarly

 #KT-23857 Fixed
2018-08-21 12:38:05 +02:00
Alexander Udalov
1464a4ac58 Load Java parameter names correctly in BinaryJavaMethod
PSI-based implementation (accessible via
`-Xuse-old-class-files-reading`) loads parameter names from the
"MethodParameters" attribute if it's present, so our own implementation
should as well.

This metadata doesn't seem supported in the java.lang.model.element API
though, so SymbolBasedValueParameter (which is used in `-Xuse-javac`)
will continue to have incorrect behavior for now

 #KT-25193 Fixed
2018-07-18 18:15:09 +02:00
Alexander Udalov
0f0602230a Fix parameter names of Java inner classes in reflection
#KT-25541 Fixed
2018-07-18 18:15:09 +02:00
Alexander Udalov
873e1b01d6 Merge and improve tests on Java parameter metadata in reflection 2018-07-18 18:15:08 +02:00
Denis Zharkov
0b3048f60a Replace trivial usages of suspendCoroutineOrReturn in tests
This is necessary since suspendCoroutineOrReturn gets removed in 1.3
2018-07-09 15:27:19 +03:00
Denis Zharkov
f23a0c8fea Add ContinuationAdapter to coroutine tests helpers
It allows having the same Continuation implementations for different
API versions
2018-07-09 15:27:19 +03:00
Alexander Udalov
e689733f69 Revert "Map Kotlin TYPE target to Java TYPE_USE in bytecode"
This reverts commit d122406dca.

See KT-23857

 #KT-24952 Fixed
2018-06-19 12:08:18 +02:00
Mikhael Bogdanov
a0060dd25b Generate synthetic method for @JvmDefault properties in DefaultImpls 2018-06-08 10:08:23 +02:00
Mikhael Bogdanov
ad717d5335 Support properties in compatibility mode 2018-05-29 15:08:07 +02:00
Mikhael Bogdanov
020573ef3c Don't generate compatibility suffix twice for properties 2018-05-29 09:29:48 +02:00
Mikhael Bogdanov
60f2dbeb8a Support property accessor in compatibility mode 2018-05-29 09:29:48 +02:00
Mikhael Bogdanov
340920fe38 Support compatibility mode for @JvmDefault 2018-05-28 22:15:45 +02:00
Mikhael Bogdanov
065780de4c Switch enableJvmDefault to jvmDefaultMode 2018-05-28 22:15:42 +02:00
Alexander Udalov
d122406dca Map Kotlin TYPE target to Java TYPE_USE in bytecode
And TYPE_PARAMETER -> TYPE_PARAMETER similarly

 #KT-23857 Fixed
2018-05-24 14:41:22 +02:00
Ilmir Usmanov
f60787d57c Move coroutines to kotlin.coroutines package: tests
Introduce COMMON_COROUTINES_TEST directive.
Every test with this directive is run twice: one time with
language version 1.2 and kotlin.coroutines.experimental package
and the other time with language version 1.3 and kotlin.coroutines
package. Each run is a separate method: with suffixes _1_2 and _1_3
respectively.
However, since codegen of release coroutines is not supported in JS
backend, we generate only one method: with suffix _1_2.
 #KT-23362
2018-04-23 21:51:59 +03:00
Mikhael Bogdanov
08ff1de248 Update test data 2018-04-03 19:38:37 +02:00
Mikhael Bogdanov
38f8924ae3 Update test data. Use simple ''@JvmDefault' instead full qualifier 2018-04-03 19:18:15 +02:00
Mikhael Bogdanov
2a8041e77e Check method abstractness during bridge generation per method not interface 2018-04-03 19:18:14 +02:00
Mikhael Bogdanov
f290b325ee Remove @JvmDefault members from delegation 2018-04-03 19:18:14 +02:00
Mikhael Bogdanov
d84a15c0f6 Support inline for private @JvmDefault members 2018-04-03 19:18:13 +02:00
Mikhael Bogdanov
308283e52e Support synthetic accessors for @JvmDefault members 2018-04-03 19:18:12 +02:00
Mikhael Bogdanov
fe45eb2a81 Initial support of @JvmDefault 2018-04-03 19:18:09 +02:00
Mikhael Bogdanov
c143480727 Remove wrong directive
Similar test exists under 'defaults' foldes
2018-04-03 19:18:07 +02:00
Mikaël Peltier
e1f44d6237 Move tests to the right place 2018-02-09 09:10:53 +03:00
Mikaël Peltier
9274241c0e KT-22714 Avoid to generate unecessary checkcast
- StackValue already avoid to generate checkcast from a type or an
array to java.lang.Object. Add a new case to avoid to generate a
checkcast from an array to an array of java.lang.Object when arrays
have the same dimensions.

Fix of https://youtrack.jetbrains.com/issue/KT-22714
2018-02-09 09:10:53 +03:00
Mikhael Bogdanov
ad48099ca6 Move java 8 tests to java8 folder 2018-02-06 10:32:14 +01:00
Mikhael Bogdanov
c9d0ab38cf Generate proper java parameter names for DefaultImpls
#KT-21919 Fixed
2017-12-22 10:02:04 +01:00
Mikhael Bogdanov
a547019ed0 Switch DEFAULT_METHOD_CALL_FROM_JAVA6_TARGET according to LL 2017-11-17 13:48:44 +01:00
Mikhael Bogdanov
232d1bd9ef Switch warning to error for java-default method calls within 1.6 target
#KT-15825 Fixed

(cherry picked from commit 9b29ebb)
2017-10-11 19:20:24 +03:00
Mikhael Bogdanov
69457ef3f1 Generate optimized hashCode for primitive type with jvmTarget 1.8+
#KT-7571 Fixed
2017-06-28 13:44:07 +02:00
Mikhael Bogdanov
496a21254b Black box update 2017-03-20 18:46:01 +01:00
Mikhael Bogdanov
a03ed6f742 Fix for KT-16581: VerifyError when calling default value parameter with jvm-target 1.8
#KT-16581 Fixed
2017-03-03 11:21:42 +01:00
Denis Zharkov
f2aacf774e Get rid of redundant not-null assertion for parameter
The problem was that in `Function<T>.apply(T)` T is now not-platform,
so when checking if not-null assertion is needed for parameter in SAM,
it's defined by the upper bounds of T that is a platform (Any..Any?),
and while it's definitely not marked as nullable it's still nullable
in a sense that it can contain null as a value.

So the solution is obvious

 #KT-16413 Fixed
2017-02-20 15:46:49 +03:00
Denis Zharkov
1bb40afada Simplify compatibility mode with ll=1.0 on JDK dependent built-ins
A lot of problem arise with current solution
(loading them with lowpriority annotation + additional call checkers):
- We errorneously treated ArrayList.stream as an existing method, while
  it's just a fake override from List
- The same problem arises when creating a class delegating to List.
  Also the latter case is failing with codegen internal error
  (see issue KT-16171)

The negative side of this solution is that instead of reporting meaningful
diagnostic, there will be UNRESOLVED_REFERENCE.
But it seems to be better than having strange problems like ones described above.

 #KT-16073 Fixed
 #KT-16171 Fixed
2017-02-08 16:04:19 +03:00
Denis Zharkov
c362a9154b Rename SUSPENDED_MARKER to COROUTINE_SUSPENDED 2017-01-27 23:24:13 +03:00
Denis Zharkov
8fa8ba7055 Move coroutine-related runtime parts to kotlin.coroutines.experimental package
#KT-15975 Fixed
2017-01-27 23:24:13 +03:00
Mikhael Bogdanov
25d75bcd8b Delegates to java defaults methods in compatibility mode 2017-01-26 14:32:33 +01:00
Dmitry Petrov
a974ed1049 Support custom accessors for top-level properties in scripts. 2017-01-26 10:12:13 +03:00
Mikhael Bogdanov
fc4be17623 Fix for KT-14966: Regression: VerifyError on access super implementation from delegate
#KT-14966 Fixed
2017-01-25 15:56:55 +01:00
Mikhael Bogdanov
11578c602e Added inline tests for jvm 8 target 2017-01-25 15:56:55 +01:00
Mikhael Bogdanov
da1b8a02ed Exclude builtins members mapped to java default methods from delegation 2017-01-20 13:16:58 +01:00
Mikhael Bogdanov
591de36666 Added deprecated diagnostic for invoking default methods within jvm-target 1.6 2017-01-18 10:50:59 +01:00
Denis Zharkov
c7f76d7ec8 Minor. Fix tests after CoroutineContext introduction 2017-01-14 15:13:36 +03:00
Denis Zharkov
2cb9d3a8ad Move coroutine intrinsics to kotlin.coroutine.intrinsics package
Also rename val SUSPENDED to SUSPENDED_MARKER

 #KT-15698 Fixed
2017-01-14 13:24:53 +03:00
Mikhael Bogdanov
09eeb414fe New test for jvm8 nondefaults target 2017-01-13 13:52:57 +01:00
Mikhael Bogdanov
d278a5c6d5 Move java 8+defaults tests to separate folder 2017-01-13 13:52:57 +01:00
Mikhael Bogdanov
0a363fd1a5 Introduced test flag: JVM8_TARGET_WITH_DEFAULTS 2017-01-13 13:52:56 +01:00
Mikhael Bogdanov
7f8acbb759 Use proper flag for interface method invocation 2017-01-13 13:52:55 +01:00
Mikhael Bogdanov
f1c1fcf0fc Fix for KT-11969: ProGuard issue with private interface methods
#KT-11969 Fixed
2016-12-27 14:07:37 +01:00