Commit Graph

62 Commits

Author SHA1 Message Date
Dmitry Petrov
a08e70879f KT-13161 java static methods call not working for typealias
Introduce special qualifier for type aliases with member scope
containing static class members only.
2016-07-28 17:38:36 +03:00
Denis Zharkov
adff666b0e Introduce additional overridability rule
It works only for Java methods and it's purpose is Java overridability rules emulation,
namely distinction of primitive types and their wrappers.

For example `void foo(Integer x)` should not be an override for `void foo(int x)`

 #KT-11440 Fixed
 #KT-11389 Fixed
2016-07-04 15:44:00 +03:00
Alexander Udalov
c4a568efff Minor, add test cases for obsolete protected-related issues 2016-04-07 00:07:11 +03:00
Denis Zharkov
1511a03027 Fix SAM adapters substitution
Approximate sourceFunction types if it's needed

 #KT-11696 Fixed
2016-03-31 14:52:12 +03:00
Michael Bogdanov
6737bc12f1 Fix for KT-11519: Version 1.0.1 fails with NPE in com.sun.beans.TypeResolver.resolve() where v1.0.0 works fine
#KT-11519 Fixed
2016-03-24 15:18:31 +01:00
Alexander Udalov
2564a2f91f Do not include kotlin-reflect at runtime by default in codegen tests
Change some tests to either include reflection or to avoid using it
2016-03-09 10:25:38 +03:00
Alexander Udalov
65662d7c99 Remove incorrect test, to be reconsidered in the future
Before 3ca4097, 'set' signature was not checked at all in this case

 #KT-11272 Open
2016-03-02 20:44:23 +03:00
Alexander Udalov
280ad195ee Migrate boxAgainstJava tests to multi-file framework 2016-03-02 15:47:36 +03:00
Alexander Udalov
12cf70ac38 Delete legacy codegen tests with Java on annotations
After cleanup, these tests are now duplicated with those in
boxAgainstJava/annotations/
2016-03-02 15:47:35 +03:00
Ilya Gorbunov
25c4453dc5 Cleanup deprecated symbol usages in testData 2016-01-22 05:54:38 +03:00
Valentin Kipyatkov
3a7ed33de1 KT-10747 "Incompatible stack heights" when compiling call to Java setter with non-void return type using property syntax
#KT-10747 Fixed
2016-01-21 10:48:47 +03:00
Denis Zharkov
871fe7680b Load special override as HIDDEN in case of signature clash
#KT-10151 Fixed
2015-12-11 22:41:03 +03:00
Yan Zhulanow
9d1af5a17e Fix tests: "infix modifier required" and "operator modifier required" errors 2015-11-27 15:51:11 +03:00
Mikhail Glukhikh
4e44466cf9 Exposed visibility deprecation warnings made errors + relevant test fixes 2015-11-20 15:21:01 +03:00
Ilya Gorbunov
3639afafce Deprecated with ERROR preconditions with eager message. 2015-11-11 19:00:03 +03:00
Yan Zhulanow
9ae3b0fa9c Drop loading Java annotation methods as functions 2015-10-16 22:13:34 +03:00
Dmitry Jemerov
1523d5bcbf removing static type assertions work in progress 2015-10-12 11:11:23 +02:00
Yan Zhulanow
fd3c28c950 Forbid Foo<T>.Bar 2015-10-08 18:31:07 +03:00
Ilya Gorbunov
e40a5457e3 Fix deprecations in testData: arrayOf usages. 2015-09-19 04:32:56 +03:00
Denis Zharkov
bae3320d52 Get rid of deprecated annotations in testData 2015-09-18 10:14:32 +03:00
Mikhail Glukhikh
eab288bdd7 annotation() now has no arguments. Syntax migration to Retention / Repeatable / MustBeDocumented combination
Deprecated test for annotation(params) completion deleted. A lot of tests changed.
2015-09-04 19:21:12 +03:00
Alexander Udalov
ea8fe56704 Include property type to KProperty.toString 2015-08-28 21:11:31 +03:00
Valentin Kipyatkov
468919f5d9 Fixed codegen crash on use of protected synthetic extension property 2015-08-12 18:17:09 +03:00
Valentin Kipyatkov
9150c53832 Fixed codegen for non-public SAM-adapters 2015-08-04 18:05:57 +03:00
Alexander Udalov
936bede8b1 Support mapping between Kotlin functions and JVM methods/constructors 2015-07-29 21:36:41 +03:00
Denis Zharkov
3ec00114c0 Check type of elvis with expected type info
#KT-6713
2015-07-21 15:16:06 +03:00
Valentin Kipyatkov
1c52f8a524 Fixed synthetic properties for method inherited from two bases 2015-07-21 08:32:51 +03:00
Valentin Kipyatkov
612c009f6b Synthetic properties: correct behaviour for method hierarchies 2015-07-21 08:32:51 +03:00
Valentin Kipyatkov
08754b9fc0 Support for synthetic extensions in codegen 2015-07-16 13:49:13 +03:00
Pavel V. Talanov
c313887641 Split CompileTimeConstant into two entities
1. ConstantValue
	* just holds some value and its type
	* implementations for concrete constants
2. CompileTimeConstant
	* is only produced by ConstantExpressionEvaluator
	* has additional flags (canBeUsedInAnnotation etc)
	* has two implementations TypedCompileTimeConstant containing a constant value
		and IntegerValueConstant which does not have exact type
	* can be converted to ConstantValue

Adjustt usages to use ConstantValue if flags are not needed
Add tests for some uncovered cases
2015-07-16 02:28:05 +03:00
Mikhail Glukhikh
609d696202 Annotations have now retention of "RUNTIME" by default. Java retention is generated as given by kotlin annotation. Annotation rendering changed.
Annotation arguments with default values are rendered as ... if renderDefaultAnnotationArguments is true.
Tests: java retention does not taken into account by Descriptor comparator.
Java retentinon changed to kotlin retention in some tests + one new test with java retention added.
More accurate tests for intentions in byte code (visibility controlled).
2015-07-14 16:25:01 +03:00
Alexander Udalov
290983687d Fix generation of bridges for lambdas
#KT-8447 Fixed
2015-07-10 20:10:16 +03:00
Alexander Udalov
048a9b686e Generate separate anonymous class for each property reference
Each property reference obtained by the '::' operator now causes back-end to
generate an anonymous subclass of the corresponding KProperty class, with the
customized behavior. This fixes a number of issues:

- get/set/name of property references now works without kotlin-reflect.jar in
  the classpath
- get/set/name methods are now overridden with statically-generated property
  access instead of the default KPropertyImpl's behavior of using Java
  reflection, which should be a lot faster
- references to private/protected properties now work without the need to set
  'accessible' flag, because corresponding synthetic accessors are generated at
  compile-time near the target property

 #KT-6870 Fixed
 #KT-6873 Fixed
 #KT-7033 Fixed
2015-07-10 20:10:09 +03:00
Alexander Udalov
30794060a9 Simplify property hierarchy in reflection
Leave only 3*2 = 6 classes: KProperty0, KProperty1, KProperty2 and their
mutable analogs, depending on the number of receivers a property takes
2015-07-10 20:10:09 +03:00
Alexander Udalov
4dcc373a5a Fix concrete method inheritance in interfaces
For each non-abstract non-declared (i.e. inherited from supertypes) method in
an interface we generate its static form to the TImpl, which calls the TImpl
method from the corresponding supertype.

The accidental override tests changed because we're now trying to generate the
delegate for the super method, not knowing that it will clash with the declared
method

 #KT-2888 Fixed
 #KT-5393 Fixed
2015-06-17 16:23:56 +03:00
Alexander Udalov
f81c364999 Add test cases for obsolete issues
#KT-3407 Obsolete
 #KT-4753 Obsolete
2015-06-17 16:23:55 +03:00
Alexander Udalov
4141e0a8df Introduce fictitious numbered Function class descriptors 2015-05-26 15:04:54 +03:00
Dmitry Jemerov
4bdf598bfe compiler testdata: s/trait/interface 2015-05-12 19:43:17 +02:00
Denis Zharkov
29bf24b7d3 Use properties of Java annotations in codegen tests
Retain obsolete versions until support for methods in Java annotations is dropped
2015-04-23 08:27:42 +03:00
Denis Zharkov
f5111180c3 Load Class<?> as KClass<*> for Java annotations parameters 2015-04-16 10:40:20 +03:00
Denis Zharkov
a29c0ff9a3 Use default value if annotation vararg argument is empty 2015-04-07 19:31:30 +03:00
Stanislav Erokhin
3de0dff575 Migrate testdata to new lambda syntax 2015-04-07 13:08:53 +03:00
Alexander Udalov
72aa3d1465 Use mock JDK in compiler tests where full JDK is not needed
- move some of boxWithStdlib tests under fullJdk/ directory, where they will be
  compiled against the full JDK
- introduce FULL_JDK in-text directive for the reflection test as only 4 tests
  out of 654 needed the full JDK
2015-04-02 21:57:48 +03:00
Dmitry Jemerov
827d9d48c1 Correctly apply SAM conversions in superclass constructor calls
#KT-5452 Fixed
2015-03-26 19:03:42 +01:00
Pavel V. Talanov
06916d98c6 default -> companion: replace all mentions of default and default object 2015-03-17 15:47:39 +03:00
Denis Zharkov
e65382e6ec Support secondary constructors in JVM backend
There is a lot of changes about closures calculating and generating.

1. As classes can have more than one constructor each of them should
have closure arguments.

2. Captured variables set is the same for all of them.

3. Within constructors bodies/delegating calls closure parameters
should be accessed through method arguments because fields may be
not initialized yet.
2015-03-11 17:45:27 +03:00
Alexander Udalov
b93b9bd565 Support KClass.simpleName and built-in class literals 2015-03-11 16:42:43 +03:00
Alexander Udalov
fdfd808d80 Remove KForeignMemberProperty and KClassOrigin, use KMemberPropertyImpl instead 2015-03-11 16:42:36 +03:00
Pavel V. Talanov
59f192ef90 Replace 'class object' with 'default object' in renderers and test data
Includes changes to decompiled text
Old syntax is used in builtins and project code for now
2015-03-06 19:36:54 +03:00
Alexander Udalov
a7b88e9485 Make CharSequence.length a function instead of property
And String.length as well.

This is done for JVM interoperability: java.lang.CharSequence is an open class
and has a function 'length()' which should be implemented in subclasses
somehow.

A minor unexpected effect of this is that String.length() is now a compile-time
constant (it wasn't such as a property because properties are not supported in
compile-time constant evaluation)

 #KT-3571 Fixed
2014-11-27 20:38:17 +03:00