Commit Graph

47 Commits

Author SHA1 Message Date
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
Andrey Breslav
5be4dda58b Unit obtained through a generic substitution should not be mapped to VOID 2014-10-13 15:38:14 +04:00
Andrey Breslav
a737352b5d Assertions when approximating platform types in delegation by expression 2014-10-13 15:38:13 +04:00
Evgeny Gerashchenko
b80f82dffd Fixed filename case. 2014-10-07 20:57:05 +04:00
Evgeny Gerashchenko
b062548392 Expanded and simplified test for generating bridges in sam conversions. 2014-10-07 17:48:17 +04:00
Michael Bogdanov
6bcb2e9001 Temporary fix for KT-5912
#KT-5912 Fixed
2014-10-07 17:48:17 +04:00
Alexander Udalov
cd0551078c Support static method references
#KT-5123 Fixed
2014-09-26 18:48:43 +04:00
Andrey Breslav
b8b0316d97 Reporting ACCIDENTAL_OVERRIDE on jvm signatures that have no descriptors
(marking them SYNTHETIC)
2014-09-10 17:35:54 +04:00
Denis Zharkov
c4746bc90f Assignment operations test fix:
these methods used in expressions like a = a + b, so they need to return
NotNull when receiver is NotNull
2014-07-28 22:00:15 +04:00
Alexander Udalov
a79398fa00 Don't load Object as a supertype for Java classes
#KT-4890 In Progress
 #KT-5002 Fixed
2014-07-25 21:19:37 +04:00
Alexander Udalov
704de8992e Support mapping between Java and Kotlin reflection objects 2014-07-02 01:55:55 +04:00
Alexander Udalov
a8e1de48b8 Support :: references to Java instance fields in codegen
#KT-1183 In Progress
2014-07-02 01:26:19 +04:00
Alexander Udalov
09863445bb Rename tests: boxWithJava -> boxAgainstJava 2014-06-26 20:57:40 +04:00