Commit Graph

1629 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 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 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 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
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 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 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 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
Georgy Bronnikov 769344569d Mute tests that are new to 1.3-M2 2018-08-30 16:24:48 +03:00
Ilmir Usmanov 2d04acba42 Update test data of compiler tests, except IR tests 2018-08-30 16:24:41 +03:00
Dmitry Savvinov 23c945b002 Remove specific language version in testMetadataField
- Why we bother? Because this test tries to read @Metadata via
reflection, and in 1.3 @Metadata has @Since("1.3") annotation. Thus,
with version fixed to 1.2, this test fails with UNRESOLVED_REFERENCE

- Why it is correct? Because initially this directive was used to enable
'LanguageFeature.JvmPackageName' (we didn't have infrastructure for
enabling particulare feature at that moment). So, now we could change it
to the '!LANGUAGE:+JvmPackageName', but it is actually redundant,
because master is already >= 1.2
2018-08-30 16:24:34 +03:00
Dmitry Savvinov b064c48f83 Fix testdata after advancing LATEST_STABLE to 1.3
This commit contains minor changes in testdata, where test and behavior
change are not related
2018-08-30 16:24:31 +03:00
Ilmir Usmanov e8597d706d Implement debug-friendly Continuation.toString()
#KT-18986 Fixed
2018-08-30 16:20:52 +03:00
Ilmir Usmanov 208c3a51ab Use short jvm names for the annotation parameters 2018-08-30 16:19:44 +03:00
Ilmir Usmanov 22f9a6ce08 Add coroutines debug metadata: compiler
#KT-25557 Fixed
 #KT-25559 Fixed
2018-08-30 16:19:41 +03:00
Ilmir Usmanov fe451dce31 Implement correct is check for SuspendFunction
Add test for suspend functions with language version 1.2.
Minor edit in SuspendFunction docs.
2018-08-30 16:17:46 +03:00
Dmitry Petrov a205019156 Additional tests and fixes for function name mangling 2018-08-30 14:58:54 +03:00
Dmitry Petrov 99498eb7b8 Use 'name-hash' mangling scheme
'-' is allowed as a name character both in JVM and in Dalvik, but can't
be a part of a Java identifier.
2018-08-30 14:58:52 +03:00
Dmitry Petrov a56d1d3ce8 Mangle function names with inline class parameters
Avoid name clashes in cases such as

  inline class Login(val login: String)
  inline class Password(val password: String)

  fun validate(login: Login) { ... }
  fun validate(password: Password) { ... }
2018-08-30 14:58:50 +03:00
Denis Zharkov f594cb22e8 Add "LANGUAGE_VERSION: 1.2" directive where it's necessary 2018-08-30 14:58:41 +03:00
Ilya Gorbunov 6d33313d2e Regenerate range iteration tests 2018-08-30 14:58:22 +03:00
Ilmir Usmanov b7b5fd75b8 Minor. Fix tests 2018-08-30 14:57:50 +03:00
Ilmir Usmanov e93683621a Implement callSuspend and callSuspendBy functions as KCallable's
extension methods.
Also make isSuspend a member of KCallable.
 #KT-21972: Fixed
2018-08-30 14:57:48 +03:00
Anton Bannykh a83baee67b review fixes + DCE data update + test (un)muting 2018-08-30 14:57:27 +03:00
Anton Bannykh 2663d9751a JS: support unsigned constants inside string templates 2018-08-30 14:57:24 +03:00
Anton Bannykh 6103df0b31 JS: support signed constant expressions as unsigned primitive arguments 2018-08-30 14:57:22 +03:00