Commit Graph

1108 Commits

Author SHA1 Message Date
Pavel V. Talanov 06916d98c6 default -> companion: replace all mentions of default and default object 2015-03-17 15:47:39 +03:00
Michael Bogdanov 11ce50f0d6 Tests for obsolete KT-6434: android compile error: local variable type mismatch
#KT-6434 Obsolete
2015-03-17 11:39:28 +03:00
Michael Bogdanov 0999cd99e3 Inline iterator test 2015-03-16 18:52:05 +03:00
Michael Bogdanov 3a5b55fc61 Mute some tests 2015-03-16 18:52:04 +03:00
Michael Bogdanov 5c6b9b1bc6 New smap test 2015-03-16 18:52:04 +03:00
Alexander Udalov 8af6ca5279 Delete kotlin.jvm.internal.KObject
It was supposed to be used in reflection but the benefits do not outweigh the
cost of KT-6951

 #KT-3223 Fixed
 #KT-6951 Fixed
2015-03-12 23:15:38 +03:00
Stanislav Erokhin fa9ca54e78 Fixed local return inside function expression. 2015-03-12 17:11:47 +03:00
Stanislav Erokhin a89b48c577 Backend support for function expression 2015-03-12 17:11:46 +03:00
Stanislav Erokhin a33450395c Resolve parenthesized element as expression 2015-03-12 17:11:43 +03:00
Stanislav Erokhin 2c8cf05f7a Added backend tests with closure local function in local class 2015-03-12 17:11:42 +03:00
Pavel V. Talanov 2987e72d29 Do not report redeclaration when outer class and default object's members clash
Previously we prohibited classes and properties with the same name (now it's unnecessary)
Add test for backends that they support qualified (by default object name) member references inside class body
2015-03-11 21:06:05 +03:00
Denis Zharkov 70c573864a Prohibit DelegationBy specifier when no primary constructor
Also add codegen test for case when there is primary
2015-03-11 17:45:29 +03:00
Denis Zharkov 4022982760 Add synthetic argument to default constructors
It's need to add synthetic argument (of type that user can't use)
to constructors with default arguments to avoid clashing with
real user's constructor having the same set of parameters
and additional int's arguments.
2015-03-11 17:45:28 +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
Denis Zharkov f07566d30d Add warning for initializers with obsolete syntax
Expected 'init' keyword before class initializer
2015-03-11 17:45:26 +03:00
Alexander Udalov dc4dfbeec1 Fix generic class literals, substitute type parameters with stars 2015-03-11 16:42:47 +03:00
Alexander Udalov 6468515d99 Report error when LHS of class literal is not a class 2015-03-11 16:42:45 +03:00
Alexander Udalov b93b9bd565 Support KClass.simpleName and built-in class literals 2015-03-11 16:42:43 +03:00
Alexander Udalov 6e45c6f17c Support class literals (A::class) 2015-03-11 16:42:41 +03:00
Alexander Udalov b3cdd818f0 Support member extension properties, implement KClass.getExtensionProperties()
#KT-6570 Fixed
2015-03-11 16:42:38 +03:00
Alexander Udalov da209e673c Implement KClass.getProperties()
#KT-6570 In Progress
2015-03-11 16:42:37 +03:00
Alexander Udalov fdfd808d80 Remove KForeignMemberProperty and KClassOrigin, use KMemberPropertyImpl instead 2015-03-11 16:42:36 +03:00
Alexander Udalov ff0044f66a Use descriptors for reflection on extension properties 2015-03-11 16:42:34 +03:00
Alexander Udalov 1a618deeab Use descriptors for reflection on top level properties
This also allows to obtain a Field object from the package part (see
mapping.kt)
2015-03-11 16:42:33 +03:00
Alexander Udalov 64fdb18ad3 Use descriptors for reflection on class properties
- use ConcurrentHashMap as a cache of class loaders to module descriptors
- KClassImpl now has a lazy class descriptor and it manages property creation
  by looking (also lazily) for the property descriptor in the corresponding
  scope
- since deserialized descriptors have full information about where a JVM symbol
  is located and what signature it has, new tests will begin to pass where
  Kotlin model and Java reflection model differ, see classObjectVar.kt
2015-03-11 16:42:31 +03:00
Alexander Udalov a8046020fb Rename kotlin.reflect.IllegalAccessException -> IllegalPropertyAccessException
The former name clashes with java.lang.IllegalAccessException and proved to be
inconvenient because it should always be qualified in the source.

Also use java.lang exception's message as kotlin.reflect exception's message
2015-03-07 02:32:15 +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
Evgeny Gerashchenko 14b16ff87c KT-6916 Slow bytecode for downTo iteration like for (i in max downTo min)
#KT-6916 fixed
2015-03-06 13:43:02 +03:00
Dmitry Jemerov c029fa2ed0 add test for generating annotations on the setter of a delegated property; (KT-4169); properly generate backing field for delegated property with a setter 2015-03-05 19:04:18 +03:00
Dmitry Jemerov 48b0afd84d correctly generate safe casts from Unit type
#KT-4494 fixed
2015-03-05 11:59:23 +01:00
Dmitry Jemerov 2835459920 correctly generate 'in' expressions with IntRange on RHS and a type other than Int on LHS 2015-03-05 11:33:24 +01:00
Dmitry Jemerov 1188be9070 generate correct bytecode for constructors using infix call syntax
#KT-4589 Fixed
2015-03-05 11:26:27 +01:00
Nikolay Krasko 30a50746b5 Intrinsic default objects implementation: tests 2015-03-05 01:30:38 +03:00
Dmitry Jemerov e60aafb18a regression test for KT-3421 2015-03-04 17:43:38 +01:00
Dmitry Jemerov 46e0fdc067 regression test for KT-3442 2015-03-04 17:41:27 +01:00
Dmitry Jemerov 7522eb4032 regression test for KT-3903 2015-03-04 17:32:40 +01:00
Dmitry Jemerov 18e54322b8 regression test for KT-4281 2015-03-04 17:27:55 +01:00
Dmitry Jemerov a2e22c6d20 regression test for KT-3107 2015-03-04 17:24:58 +01:00
Pavel V. Talanov ffabe19229 Prohibit accessing nested classes/objects of class object using class literal
The fqname of class should be clear from code
Example: can't shorten A.Default.B.Default.C to A.B.C
Also fixes problem when nested class of enum class could be accessed via enum entry
2015-03-03 13:04:29 +03:00
Pavel V. Talanov cceb5738c8 Can't omit default object name in imports and types
There should be only one way to denote a type (A.Default.B can't be denoted as A.B)
2015-03-03 13:04:28 +03:00
Alexander Udalov 2c0830b017 Change synthetic accessor method names to "access$..."
As per discussion in https://youtrack.jetbrains.com/issue/KT-6870
2015-02-27 20:30:51 +03:00
Yan Zhulanow fa62d3bcec Move Android compiler plugin tests to android-compiler-plugin module 2015-02-26 15:25:48 +03:00
Mikhail Mutcianko bf25dffb85 add android bytecode persistence test 2015-02-26 15:25:37 +03:00
Mikhail Mutcianko 08245ffe1c add android properties box tests 2015-02-26 15:25:31 +03:00
dedoz f2ab424c41 add generated tests 2015-02-26 15:25:31 +03:00
Alexander Udalov 6f0ccbfab8 Reuse class loader for kotlin-runtime.jar in codegen tests
Also delete questionable ClassPathInParentClassLoaderTest
2015-02-25 20:13:47 +03:00
Pavel V. Talanov 96e54b4872 Test accessing class object from java 2015-02-16 15:38:45 +03:00
Pavel V. Talanov 7b837e2631 Updata test data: txt files for diagnostics tests 2015-02-16 15:38:36 +03:00
Pavel V. Talanov a1f4c06a49 Update test data that mentioned old JvmAbi constants 2015-02-16 15:38:34 +03:00
Pavel V. Talanov 894c3bceac Test: add jvm backend test for named class object 2015-02-16 15:38:29 +03:00