Commit Graph

3221 Commits

Author SHA1 Message Date
Yan Zhulanow d16b55033e Introduce new naming convention for captured receiver backing fields
'receiver$0' -> '$this_<label>'
2018-09-11 16:41:20 +03:00
Mikhail Zarechenskiy 66a00f442c Add tests for obsolete issues
#KT-12008 Obsolete
 #KT-11881 Obsolete
 #KT-10822 Obsolete
2018-09-11 12:34:09 +03:00
Dmitry Petrov 58442899b8 Postpone NoConstantValueAttributeForNonConstVals till 1.4
Requires special inspection for migrating Java code.
2018-09-11 11:27:33 +03:00
Dmitry Petrov e3fa785678 Minor: drop irrelevant test case
Hiding constructors with inline class type parameters
is tested by bytecodeListing tests
2018-09-10 17:45:05 +03:00
Ilya Chernikov 01dd665441 Simple test for non-kts script compilation 2018-09-10 11:21:27 +02:00
Dmitry Petrov bbbca9fbbf Minor: mute inline classes tests in JVM_IR 2018-09-10 10:42:18 +03:00
Mikhail Zarechenskiy 7595cb23ab Raise deprecation level for mod operators to ERROR in stdlib
#KT-25217 In Progress
2018-09-09 23:55:36 +03:00
Roman Elizarov e2713501ce Rename SuccessOrFailure to Result and hide Failure from ABI
* The members of Result are isSuccess, isFailure, exceptionOrNull, getOrNull
* The rest of API is implemented via inline-only extensions
* There are two internal functions to hide detailed mechanics of an internal
  Result.Failure class: createFailure and throwOnFailure
* Result.toString is explicit: either Success(v) or Failure(x)

See KT-26538
2018-09-09 11:34:31 +03:00
Dmitry Petrov 006c0aa740 Hide constructors accepting inline class parameters 2018-09-07 15:57:59 +03:00
Alexander Udalov ab3f8db743 Consider property accessor non-default if it has annotations
Otherwise we're not trying to load annotations on the parameter of the
property setter in MemberDeserializer.loadProperty.

Note that after this commit, we could now also assume that if
getter/setter is default, it has no annotations, and thus use
Annotations.EMPTY for default getter/setter in loadProperty. However,
this would cause reflection to work incorrectly on classes compiled by
an older Kotlin compiler, so we'll still try to load annotations on
default accessors for an indefinite time.

 #KT-25499 Fixed
2018-09-07 11:49:42 +03:00
Alexander Udalov 06ce0cb0f0 Fix deserialization of default property accessor flags
In MemberDeserializer.loadProperty, we incorrectly passed 0 to
getAnnotations when loading annotations on property accessors in case
the protobuf field getter_flags/setter_flags was not present. The
correct behavior, as described in metadata.proto, was to pass a special
"default accessor flags" value, constructed from the main property
flags. Otherwise in case there were annotations both on the property and
on the accessor (as in PropertyAndAccessor.kt) and the accessor was
otherwise default, we would assume that it had no annotations and would
not load them in compiler and reflection

 #KT-25499 In Progress
2018-09-07 11:49:41 +03:00
Dmitry Petrov 65ad93ebe4 Don't generate getter for private or internal inline class primary vals 2018-09-07 10:27:31 +03:00
Dmitry Petrov cafaa3e13c Mangle inline class members
<IMPL_SUFFIX> for method is a method signature hash,
if method value parameter types contain inline class types,
otherwise 'impl'.

Constructor methods are named as 'constructor-<IMPL_SUFFIX>'.

Synthesized 'box' and 'unbox' methods are named as
'<METHOD_NAME>-<IMPL_SUFFIX>'.

Erased implementations of overriding and non-overriding methods
are named as '<METHOD_NAME>-<IMPL_SUFFIX>'.

Fully specialized implementation of 'equals' will have a special suffix.
2018-09-07 10:25:53 +03:00
Dmitry Petrov aec173ac5c Minor: fix tests after rebase 2018-09-07 09:32:11 +03:00
Dmitry Petrov 427295525a Minor: mute test in JVM_IR 2018-09-07 09:31:33 +03:00
Dmitry Petrov 43b4190f7c Test: visibility of inline class members
Also merge in testInlineClassWrapperPrimaryConstructorIsSynthetic
and testInlineClassConstructors.
2018-09-07 09:31:33 +03:00
Dmitry Petrov d8a6db8774 Mark synthesized box/unbox methods in inline classes as ACC_SYNTHETIC 2018-09-07 09:31:26 +03:00
Dmitry Petrov d24b0fd3b2 Test: 'constructor' methods visibility 2018-09-07 09:31:26 +03:00
Dmitry Petrov 0bd1c4d1b7 Make inline class wrapper constructor private 2018-09-07 09:31:26 +03:00
Dmitry Petrov c094b3a5a2 Drop erased class for inline class 2018-09-07 09:31:26 +03:00
Dmitry Petrov ae0d980b54 Minor: mute some inline classes tests in JS_IR 2018-09-07 09:29:55 +03:00
Ilmir Usmanov 6f591369d8 Forbid provideDelegate, setValue and getValue suspend operators
#KT-24866 Fixed
2018-09-06 20:25:17 +03:00
Alexander Udalov 823a24e0a3 Use AnnotationSplitter for annotations on setter parameter
Make it possible to specify annotations of the setter parameter when
constructing the default setter via DescriptorFactory; pass the split
annotations in DescriptorResolver.resolvePropertySetterDescriptor

 #KT-25500 Fixed
2018-09-06 19:13:09 +03:00
Mikhael Bogdanov da93ff1a30 Properly cast right-hand side value for inline property setter
#KT-22649 Fixed
2018-09-06 18:04:45 +02:00
Mikhail Zarechenskiy 690762d46c Inline classes ABI: rename equals--impl to equals-impl0 2018-09-06 17:01:01 +03:00
Mikhail Zarechenskiy 83975bd6ac Generate stub for specialized equals inside inline class 2018-09-06 10:39:33 +03:00
Mikhail Zarechenskiy b4674a172e Reserve secondary constructors with bodies inside inline classes
#KT-26575 Fixed
2018-09-06 10:22:01 +03:00
Mikhail Zarechenskiy 002a66fec1 Reserve box/unbox/equals/hashCode methods inside inline classes
#KT-26573 Fixed
2018-09-06 10:20:03 +03:00
Dmitry Petrov db13ab59a6 Test: SuccessOrFailure calls don't generate erased class references 2018-09-05 12:20:57 +03:00
Dmitry Petrov 203fd6a5d6 Make inline class wrapper constructor synthetic 2018-09-05 12:20:57 +03:00
Dmitry Petrov 85826d304e Don't generate secondary constructors for inline class wrapper 2018-09-05 12:20:57 +03:00
Dmitry Petrov 65881dda97 Fix tests after rebase 2018-09-05 12:20:57 +03:00
Dmitry Petrov 1bf8cfca8b Test: property accessors are called by inline class 2018-09-05 12:20:57 +03:00
Dmitry Petrov a2900282fd Call factory method for primary constructors of inner classes
We might want to add 'init' blocks later, so now, for the sake of
binary compatibility with 1.3-RC binaries, we have to generate these
'constructor' calls.

Note that in some tests inline class boxing is no longer redundant,
because resulting value is passed to 'constructor' as an argument.
2018-09-05 12:20:57 +03:00
Dmitry Petrov b1016936b2 'box'/'unbox' methods are called by inline class 2018-09-05 12:20:57 +03:00
Dmitry Petrov 687b492bf9 Test: inline class secondary constructors are called by inline class 2018-09-05 12:20:57 +03:00
Dmitry Petrov 05daa21657 Fix inline class secondary constructor call generation
Don't generate NEW+DUP for inline class constructor calls.
2018-09-05 12:20:57 +03:00
Dmitry Petrov 80a67477db Generate method calls for inline classes through IC, not IC$Erased
IC extends IC$Erased, so it should be fine.
2018-09-05 12:20:57 +03:00
Dmitry Petrov 3080b65f7d Inline (wrapper) class IC extends erased inline class IC$Erased 2018-09-05 12:20:57 +03:00
Svyatoslav Kuzmich ad58fdd158 [JS IR BE] Unmute tests after adding stdlib 2018-09-04 20:19:04 +03:00
Roman Artemev 0eba87b571 [JS IR BE] Mute temporary broken tests 2018-09-04 12:43:39 +03:00
Alexander Udalov 4f803d03cf Minor, fix test data 2018-08-31 19:54:08 +02:00
Georgy Bronnikov 2fccf6875f Mute tests involving Char.{MIN,MAX}_VALUE, analogously to other primitive types 2018-08-31 15:44:05 +03:00
Roman Artemev 8a871b3f0c Update tests 2018-08-31 15:34:18 +03:00
Mikhael Bogdanov 5c0cdac69f JVM_IR. Support generic constructors after "Roll back constructor type parameters" 2018-08-31 15:34:18 +03:00
Roman Artemev d1621b80cc Fake wrapped descriptors first working draft
get rid of descriptors in Bridge and Enum lowerings
Replace property accessors function type with IrSimpleFunction because they couldn't be constructors
get rid of descriptors in Callable reference lowering
refactored descriptor factory and inner class lowering
Add isReified property to IrTypeParameter declaration
keep getting rid of descriptors
Get rid of descriptors in Shared Variable Manager
LocalDeclarationLowering also uses no descriptors
Fix psi2ir
Fix nested classes names
Fix outer reference in inner classes
Fix name generator
get rid of descriptors in coroutines - something is working
Fix name generator
Fix unbound symbols in JVM BE
Rename DeclarationFactory members
2018-08-31 15:34:18 +03:00
Mikhail Zarechenskiy daadba0927 Postpone conversions from signed constants to unsigned ones
#KT-26071 Fixed
2018-08-31 15:22:43 +03:00
Anton Bannykh e7f9727783 JS: fix tests related to 1.3 migration 2018-08-30 22:27:24 +03:00
Alexander Udalov ac14c5e74f Fix KType.javaType for suspend function return type
#KT-26293 Fixed
2018-08-30 16:47:48 +02:00
Ilmir Usmanov f3879af9f6 Implement suspend lambdas of big arity
Suspend functions and callable references to suspend lambdas are already
supported.
Support callSuspendBy of suspend function of big arity.
 #KT-24854: Fixed
2018-08-30 17:29:09 +03:00