Commit Graph

1243 Commits

Author SHA1 Message Date
Yan Zhulanow 74f44dddb0 Add tests for publicField 2015-07-07 16:35:23 +03:00
Dmitry Petrov 4e42cc6b81 Save/restore stack in try-expressions (and statements).
Parse TryCatchBlockNode's in generated bytecode, infer stack save/restore points.
Save stack to local variables before 'try'.
Restore stack after the beginning of try-block, catch-block, and default handler.
Integrate before/after inline markers rewriting (otherwise it'll break our stacks).

 #KT-3309 Fixed
2015-07-07 12:16:29 +03:00
Ilya Gorbunov f440d97e04 Remove unnecessary Char.toChar from tests. 2015-07-06 17:57:35 +03:00
Ilya Gorbunov 456bab40d1 Ensure value of correct return type is on stack after intrinsic Char +/- Int and Char - Char binary operations. 2015-07-06 17:57:33 +03:00
Ilya Gorbunov 222d4002ac Add char binary operations to JVM codegen tests. 2015-07-06 17:57:25 +03:00
Alexander Udalov feb4dd7b8f Drop 'OBJECT$' field deprecated in M11 2015-07-06 16:19:54 +03:00
Alexander Udalov ac0db5ce80 Fix incorrect TypeCastException message when casting null
#KT-5121 Fixed
2015-07-06 16:14:22 +03:00
Alexander Udalov cb03f0df5a Fix casts of Unit value to other types 2015-07-06 16:14:06 +03:00
Ilya Gorbunov 39b27751df Drop deprecated char operations: correct test data. 2015-07-04 04:46:23 +03:00
Mikhail Glukhikh 848c2afdb4 "is" over enum entry is now an error + new tests + test fixes 2015-06-30 19:46:30 +03:00
Ilya Gorbunov 0e896ea1bb Drop streams and iterators: correct test data. 2015-06-29 17:06:49 +03:00
Mikhail Glukhikh 6e2395471d Sealed code generation: sealed is considered abstract, correct serialization
A pair of tests provided.
2015-06-25 19:07:23 +03:00
dnpetrov f364d23ee9 KT-5347 VerifyError on local data class with closure
- generated copy() should push captured fields on stack
- refactor context lookup
- handle vars in local classes using instance fields

 #KT-5347 Fixed
2015-06-25 17:52:30 +03:00
dnpetrov c24e6b5698 Support 'break' and 'continue' in expressions
- generate fake jump instructions so that we can always analyze stack depths
- fix stack before break and continue by dropping excessive elements (e.g., *a*.foo(*b*, c?:continue))
- Analyzer rewritten in Kotlin, with more flexible control of CFG traversal

 #Fixed KT-3340
 #Fixed KT-4258
 #Fixed KT-7941
2015-06-25 17:40:55 +03:00
Mikhail Glukhikh 5fabb962ae Private constructors are now accessed via synthetic constructor with DEFAULT_CONSTRUCTOR_MARKER as an additional argument #KT-6299 Fixed
A set of tests provided. Some external tests fixed accordingly.
Companion object creation changed accordingly.
Derived classes now can use base class with the private constructor.
Refactoring of AccessorForFunctionDescriptor.
2015-06-24 12:30:11 +03:00
Michael Bogdanov b1c5002889 Remove finally marker at inlining 2015-06-24 09:48:55 +03:00
Michael Bogdanov a018e4e12a Updated exception table generation: support new exception table in non-local returns 2015-06-24 09:48:55 +03:00
Michael Bogdanov 93c5a52d13 Updated exception table generation: try block return moved to uncatched interval
#KT-8148 Fixed
2015-06-24 09:48:55 +03:00
dnpetrov 36ae8790a1 KT-8011 Compiler crashes on attempt to create local class inside lambda
- use StackValue from upper-level context if local lookup fails

 #KT-8011 Fixed
2015-06-18 17:40:24 +03:00
dnpetrov 046189087a KT-5963 Call to super shouldn't require type specification if there is no conflict
Implemented unqualified 'super' type resolution (in BasicExpressionTypingVisitor).

No overload resolution of any kind is involved.
Corresponding supertype is determined by the expected member name only:
- 'super.foo(...)' - function or property (of possibly callable type) 'foo'
- 'super.x' - property 'x'
Supertype should provide a non-abstract implementation of such member.
As a fall-back solution for diagnostics purposes, consider supertypes with abstract implementation of such member.

Diagnostics:
- AMBIGUOUS_SUPER on 'super', if multiple possible supertypes are available;
- ABSTRACT_SUPER_CALL on selector expression, if the only available implementation is abstract.

#KT-5963 Fixed
2015-06-18 14:16:34 +03:00
Alexander Udalov 1a3209e1dc Drop traits with required classes
#KT-4771 Rejected
2015-06-17 16:23:58 +03:00
Alexander Udalov 98ce0d529c Fix incorrect 'original' in property accessors
#KT-3930 Fixed
2015-06-17 16:23:56 +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
dnpetrov c369949d90 KT-6136 VerifyError on data class inheriting from trait
- coerce property values to proper data class component types
- add tests
 #KT-6136 Fixed
2015-06-16 09:58:03 +03:00
Denis Zharkov e3c3af6aab Change MISSING_CONSTRUCTOR_KEYWORD severity to error
And adjust testData
2015-06-12 11:23:13 +03:00
Denis Zharkov 414d6b92f6 Adjust testData: don't use java.lang.Class in annotations 2015-06-12 09:55:13 +03:00
Denis Zharkov c9f79c2d05 Adjust testData: get rid of obsolete annotations 2015-06-12 09:23:31 +03:00
Pavel V. Talanov 7585cbfe22 Remove check in visibilities that allowed access to privates of outer packages
It doesn't work for a while now in imports and is planned to be dropped with upcoming changes to private
2015-06-08 20:25:52 +03:00
Michael Bogdanov baa44e3d01 Fix default parameter remapping on inlining: support store instruction
#KT-7963 Fixed
2015-06-08 16:07:39 +03:00
Michael Bogdanov 7a1625fc9e Support extension lambda inlining
#KT-7962 Fixed
2015-06-08 16:07:38 +03:00
dnpetrov 50ea67ba13 KT-5524 Support [platformName] annotation for class members
@platformName is now supported for final non-overriding class member functions
(including property accessors).
Front-end provides diagnostics for inapplicable annotation cases.
Code generation updated:
- ignore kotlin.platform.platformName annotation for Java class methods;
- bridges generation generates proper JVM declarations in case of methods renamed with @platformName.
@platformName-related tests added.

#KT-5524 Fixed
2015-06-04 17:54:08 +03:00
Michael Bogdanov dee26957d1 Tests for obsolete KT-4798, KT-7288, KT-7046
#KT-4798 Obsolete
 #KT-7288 Obsolete
 #KT-7046 Obsolete
2015-06-04 16:28:08 +03:00
Denis Zharkov 9802931a90 Remove variables with empty ranges from local vars table
As their ranges may intersect after dead code elimination that leads to VerifyError
2015-06-04 16:11:02 +03:00
Michael Bogdanov 83f04501be Remove error diagnostic from return in multideclaration
#KT-5100 Fixed
2015-06-04 12:01:59 +03:00
Michael Bogdanov 2377a10007 Fix labeling processing on inlining: suport labeled literals
#KT-7273 Fixed
2015-06-03 14:42:57 +03:00
Pavel V. Talanov d2592e4a2c Companion objects have public visibility by default
#KT-7114 Fixed
2015-06-02 16:23:03 +03:00
Alexander Udalov 596d378962 Fix abstract method error: implement arity in function references 2015-06-01 19:23:09 +03:00
Alexander Udalov 28addcf8e7 Do not generate annotations of method parameters on its $default synthetic method
#KT-7892 Fixed
2015-06-01 19:23:08 +03:00
Alexander Udalov df4d5a3ae2 Fix initialization order of enum entries and companion
#KT-5761 Fixed
2015-06-01 19:23:08 +03:00
Zalim Bashorov f3f799aab5 Fix secondary constructor tests for JS -- use non-zero fracitional part 2015-05-28 10:25:12 +03:00
Zalim Bashorov 3fe363e72b Minor: split test to access to companion and to nested object 2015-05-28 10:25:11 +03:00
Zalim Bashorov dc1b91eacd JS: prepare tests for secondary constructors 2015-05-28 10:24:48 +03:00
Michael Bogdanov e20a5121c7 Support private package properties in inline functions 2015-05-27 18:09:40 +03:00
Dmitry Jemerov 1188e57597 rename @overloads annotation to @jvmOverloads 2015-05-27 12:23:08 +02:00
Alexander Udalov 6ae7ed1cc4 Add some new tests on functions and extension functions 2015-05-27 01:44:19 +03:00
Mikhail Glukhikh 4570872bfd Postfix expression code generation fixed as per KT-7561.
A set of tests for KT-7561 on codegen side, including exotic inc() functions().
 #KT-7561 Fixed.
2015-05-26 15:20:37 +03:00
Alexander Udalov 49004a8b8e Conform functions to extension functions and vice versa
#KT-5989 Fixed
2015-05-26 15:04:56 +03:00
Alexander Udalov 4141e0a8df Introduce fictitious numbered Function class descriptors 2015-05-26 15:04:54 +03:00
Michael Bogdanov 8cf21f24cd Fix for KT-7792: Invalid class file generation: java.lang.ClassFormatError: Invalid length 65522 in LocalVariableTable in class file
#KT-7792 Fixed
2015-05-25 17:06:18 +03:00