Commit Graph

46 Commits

Author SHA1 Message Date
Michael Bogdanov
5f38c1d571 Fix for KT-10729: Accessing private const field in companion object from a function in the same companion generates run-time error 2016-02-01 18:42:19 +03:00
Michael Bogdanov
874560df9d Fix for KT-10715: Verify error on incrementing backing field from accessor 2016-01-25 16:56:57 +03:00
Mikhail Glukhikh
ebda21c68a Codegen tests for lateinit var with private setter 2015-12-23 18:02:07 +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
fe13f39de9 Use of uninitialized variables in lambdas / object literals / local functions is forbidden now #KT-4475 Fixed
Local declarations CFA: variable initialization information before them is now taken into account
2015-11-17 18:21:09 +03:00
Michael Bogdanov
86f8845c00 Fix for KT-8928: NoSuchMethodError on private property setter in companion object
#KT-8928 Fixed
2015-11-03 15:41:22 +03:00
Dmitry Petrov
882827bf04 KT-9717, KT-9603:
pass getter/setter-related flags to AccessorForPropertyDescriptor
2015-10-27 12:02:27 +03:00
Mikhail Glukhikh
4b6cb3ebce A new kind of synthetic accessors for backing fields, if accessed inside lambda / object literal / local class #KT-9657 Fixed
A set of tests provided
Also #KT-4867 Fixed
Also #KT-8750 Fixed
Slight codegen refactoring
2015-10-26 16:37:32 +03:00
Alexander Udalov
51bf68ce27 Update compiler tests to use KProperty instead of PropertyMetadata 2015-10-14 20:45:54 +03:00
Denis Zharkov
f0e3fd617d Adjust testData to CharSequence.length transformation 2015-10-14 20:39:35 +03:00
Dmitry Jemerov
1523d5bcbf removing static type assertions work in progress 2015-10-12 11:11:23 +02:00
Yan Zhulanow
1f2b4e20fe Replace get() and set() to getValue() and setValue() (property delegates) 2015-10-09 22:49:16 +03:00
Mikhail Glukhikh
6914d09297 Old backing field with dollar is now forbidden 2015-10-09 21:06:26 +03:00
Mikhail Glukhikh
846d7cac69 protected is deprecated inside objects and forbidden inside annotations and enum entries 2015-10-07 10:21:11 +03:00
Yan Zhulanow
cc2d005984 Make lateinit diagnostics more clear 2015-09-25 19:51:06 +03:00
Mikhail Glukhikh
a1e3471d92 "field": deprecated warnings introduced, compiler tests migrated to the new syntax 2015-09-21 15:48:00 +03:00
Mikhail Glukhikh
9f640b00d9 "field": synthetic variable creation in accessors, codegen changed accordingly, a set of tests, relevant code fix (j2k) 2015-09-21 15:47:49 +03:00
Yan Zhulanow
4ca127ecb3 Create custom exception for lateinit 2015-09-05 00:54:20 +03:00
Yan Zhulanow
fc3bf3cca4 Implement lateinit in backend 2015-09-05 00:54:19 +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
Denis Zharkov
c9f79c2d05 Adjust testData: get rid of obsolete annotations 2015-06-12 09:23:31 +03:00
Dmitry Jemerov
4bdf598bfe compiler testdata: s/trait/interface 2015-05-12 19:43:17 +02:00
Stanislav Erokhin
b152211096 Added init keyword to testdata 2015-04-07 13:08:51 +03:00
Pavel V. Talanov
06916d98c6 default -> companion: replace all mentions of default and default object 2015-03-17 15:47:39 +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
Stanislav Erokhin
65c9ea2465 Fix variance problems. 2014-11-17 17:45:05 +03:00
Zalim Bashorov
c767ffc3e7 Unit.VALUE -> Unit in testData 2014-07-25 17:16:40 +04:00
Alexander Udalov
a07909bb52 Don't generate unnecessary accessors for private class properties 2014-07-17 19:18:05 +04:00
Alexander Udalov
d78d4bc44c Disallow extension properties with backing fields
#KT-1682 Fixed
2014-05-29 21:24:05 +04:00
Mikhael Bogdanov
596dc68ea4 KT-4340: Jvm backend generates invalid synthetic accessor for private extension property 2014-04-01 11:18:15 +04:00
Alexander Udalov
3dcd85bdb4 Add toString() to Any, fix all tests
#KT-4517 Fixed
2014-03-02 19:54:49 +04:00
Alexander Udalov
7041a10ecf Fix VerifyError on primitive override properties
Don't just blindly map property type in PropertyCodegen when generating getter:
we already have its full signature, so we can just as well take the type from
it. The former also isn't correct for properties which are overrides with a
primitive type. Simple mapType is safe for setter though, because the type of a
method parameter cannot change with override on JVM

The change in StackValue relates to call sites of properties which return Unit:
in that case StackValue's this.type is V, whereas the return type of its getter
is Ljet/Unit; -- so coerceTo was coercing from the wrong type in case of getter
calls

 #KT-4373 Fixed
 #KT-4383 Fixed
2014-01-14 17:52:27 +04:00
Mikhael Bogdanov
35f42b1a65 Tests for KT-4252: Error generating primary constructor with kind OwnerKind
#KT-4252 Obsolete
2013-11-28 10:11:26 +04:00
Mikhael Bogdanov
fb39217dc3 KT-4140 VerifyError: Property in class object
#KT-4140  Fixed
2013-10-31 12:31:22 +04:00
Alexander Udalov
2445d04338 Fix synthetic method generation for extension properties
If several annotated extension properties with the same name were declared in
one class, JVM issued a ClassFormatError, since we generated a synthetic method
for each of them with the same name and signature. Make the signature of this
synthetic method depend on a receiver parameter, if a property has one
2013-10-16 14:59:37 +04:00
Svetlana Isakova
a3f9cef354 fixed bug: 'isStatement' for function body == 'hasBlockBody'
not vice versa
2013-09-30 21:06:05 +04:00
Mikhael Bogdanov
4feb395dcc Test for static 2013-06-17 15:20:41 +04:00
Natalia.Ukhorskaya
9e584ded11 ClassFormatError because of initializing variable with Any type with primitive value
#KT-3524 Fixed
2013-05-14 15:38:42 +04:00
Natalia.Ukhorskaya
3297c0e9d3 No such field error when set private property without backing field (analog of KT-2892) 2013-04-30 21:47:21 +04:00
Mikhael Bogdanov
b0b6728c7e KT-3118 NoSuchFieldError on private property without backing field &&
KT-3551 Wrong synthetic accessor implementation
2013-04-30 15:28:02 +04:00
Mikhael Bogdanov
c69e7f059d Duplicated JetTypeMapper.mapSignature removed 2013-04-18 15:03:43 +04:00
Mikhael Bogdanov
a1d295638a ExpressionCOdegen.visitSimpleNameExpression simplification 2013-04-18 14:05:15 +04:00
Mikhael Bogdanov
93b860e4ad Always generate getter and setter 2013-03-20 20:50:06 +04:00
Alexander Udalov
41a416da60 Move blackBoxFile() testData to box/ directory
Delete all test methods (and empty test classes), since they'll be
auto-generated
2013-01-28 18:20:17 +04:00