Commit Graph

8301 Commits

Author SHA1 Message Date
Roman Artemev 0895f72570 Fix testdata 2018-08-23 14:10:11 +03:00
Dmitry Petrov 34548a0667 Fix primitive override with inline class in Kotlin-Java inheritance 2018-08-23 13:07:07 +03:00
Ilmir Usmanov 0559cfb724 Move SuspendFunction{N} interfaces to kotlin.coroutines package
#KT-25824: Fixed
2018-08-22 16:21:30 +03:00
Ilmir Usmanov 4a7703ed66 Implement correct is check for SuspendFunction
Let callable references implement SuspendFunction
Do not generate CHECKCAST SuspendFunction when LV is 1.2

 #KT-25825: Fixed
2018-08-22 16:21:27 +03:00
Dmitry Petrov 533f87ac33 Use proper KotlinType for prefix increment/decrement
Otherwise inline class values (such as UByte) are boxed incorrectly,
see KT-26219.
2018-08-22 12:24:50 +03:00
Alexander Udalov 852760b3b0 Report error on incompatible .kotlin_module files in classpath
Also remove obsolete test wrongAbiVersionNoErrors

 #KT-25973 Fixed
 #KT-26266 Open
2018-08-21 17:12:02 +02:00
Zalim Bashorov 589085369e [JS FE] Unify how the compiler checks parameters and return types for external declarations 2018-08-21 17:09:33 +03:00
Zalim Bashorov 9d0b880f67 [JS FE] Prohibit inline classes as parameter type and return type of external declarations
#KT-26171 Fixed
2018-08-21 17:09:33 +03:00
Zalim Bashorov 839bce5236 [JS FE] Prohibit external inline classes
#KT-26138 Fixed
2018-08-21 17:09:33 +03:00
Ilmir Usmanov 932b76a3f3 Minor. Unmute test 2018-08-21 14:13:19 +03:00
Alexander Udalov e56374908e Disallow using optional annotations outside common module sources
#KT-25196 Fixed
2018-08-21 12:49:10 +02:00
Alexander Udalov 0f003802fe Introduce -Xcommon-sources and pass it correctly from build tool plugins
#KT-25196 In Progress
2018-08-21 12:49:10 +02:00
Denis Zharkov ca39cc47c9 Support calling experimental coroutines API in JVM
The support is very limited, though

 #KT-25683 Fixed
2018-08-21 13:46:01 +03:00
Denis Zharkov 944b0d058a Allow calling some pieces of the experimental coroutine API
- Calling suspend functions is allowed
- Presence of suspend function type still makes declaration
unusable unless it belongs to a value parameter as a top-level type
containing less then three parameters

Still, warning should be emitted because they will become unsupported in 1.4

 #KT-25683 In Progress
2018-08-21 13:44:02 +03:00
Alexander Udalov 1c2a9e4b21 Map annotation target TYPE -> TYPE_USE if JVM target >= 1.8
And TYPE_PARAMETER -> TYPE_PARAMETER similarly

 #KT-23857 Fixed
2018-08-21 12:38:05 +02:00
Stanislav Erokhin f3e0470dcd Allow generic type parameter to have mixed constraints for @InlineOnly functions
#KT-19323 Fixed
2018-08-21 12:17:25 +03:00
Dmitry Petrov 7d4dfc87b1 Use proper KotlinType in get/set methods for property reference 2018-08-21 08:43:12 +03:00
Ilmir Usmanov d3dbcae7a4 Get rid of typed create and invoke wherever possible
in coroutine lambdas.
 #KT-26243 Fixed
2018-08-20 21:33:24 +03:00
Dmitry Petrov b5f37d18b2 Fix inlining of functions with matching JVM signatures in same package
When two functions with matching JVM signatures in the same package
were inlined sequentially, inliner could take a wrong method body from
the cache due to MethodId clash. This manifested with inline classes,
but also was possible with some legal Kotlin overloads with matching
erasure.

Use internal name of the corresponding implementation owner class
instead of FQN of the containing declaration. Such MethodIds can't match
accidentally, because corresponding JVM method signatures would clash.
2018-08-20 14:12:34 +03:00
Dmitry Petrov 5045fa446a Prohibit recursive inline classes 2018-08-20 10:08:10 +03:00
Zalim Bashorov 8966e220f0 Update tests 2018-08-17 21:44:08 +03:00
Ilmir Usmanov dcfdc781db Minor. Unmute test in JS BE 2018-08-17 16:14:28 +03:00
Dmitry Petrov b6e3218ca2 Use mapping mode for inline class underlying type without wrapping 2018-08-16 15:03:50 +03:00
Svyatoslav Kuzmich f5a80a30f7 Mute and unmute tests 2018-08-15 18:20:07 +03:00
Dmitry Petrov 8e95ecb821 Use underlying type when computing type mapping mode for inline classes 2018-08-15 15:37:46 +03:00
Dmitry Petrov 948e72f653 Inline classes can only implement interfaces 2018-08-15 15:32:50 +03:00
Ilmir Usmanov 1c098bf5cf Minor. Fix test 2018-08-15 14:23:33 +03:00
Ilmir Usmanov b4189d9e85 Minor. Use more granular assertion levels in assertion tests 2018-08-15 14:23:30 +03:00
Mikhael Bogdanov 1a1bb53381 Update IR text test
Additional implicit coercions to unit was added
2018-08-15 14:18:15 +03:00
Ilmir Usmanov 300876348a Fix line numbers generation for coerced primitives
in coroutines
 #KT-25076: Fixed
2018-08-15 13:47:45 +03:00
Ilmir Usmanov a470fd21ca Eliminate only first {ASTORE, ALOAD} in locals elimination
of ALOAD.
 #KT-25912: Fixed.
2018-08-15 13:45:24 +03:00
Svyatoslav Kuzmich ff70b837ee [JS IR BE] Support local delegated properties 2018-08-15 13:35:14 +03:00
Svyatoslav Kuzmich 392ad521fd [JS IR BE] Reflection support 2018-08-15 13:35:14 +03:00
Mikhael Bogdanov 494828f4cf Unmute jvm ir-tests 2018-08-15 10:26:28 +03:00
Denis Zharkov 117abb04aa Fix applicability of dsl-marker on function type
When marker is applied to function type it should work
like it's applied to receiver type

 #KT-23255 Fixed
2018-08-14 15:58:18 +07:00
Dmitry Petrov ebf8ec455d Box/unbox nullable inline class values with null check
When we have a nullable inline class value with non-null underlying
type, corresponding value in unboxed representation is nullable. E.g.:

  inline class Str(val value: String)

  fun test(s: Str?) = listOf(s)

Here 'test(s: Str?)' accepts nullable 'java.lang.String' as a parameter.

When boxing/unboxing nullable values of such inline classes, take care
of nulls.

 #KT-26052 Fixed Target versions 1.3-M2
2018-08-14 10:22:07 +03:00
Dmitry Petrov 56ad091534 Generate synthetic inline class methods in psi2ir 2018-08-14 10:00:21 +03:00
Dmitry Petrov de11d9164d Add IrClass.irInline 2018-08-14 10:00:21 +03:00
Mikhael Bogdanov cb31962b38 Generate old style lambda classes in jvm ir backend 2018-08-13 15:10:20 +03:00
Alexander Udalov c011bf61fe Support multiple version requirements on single element 2018-08-13 11:02:35 +02:00
Dmitry Petrov b7df36643b Implement additional declaration checks for inline classes
- Implementation by delegation is prohibited
- Delegated properties are prohibited
2018-08-13 08:49:09 +03:00
Dmitry Petrov 0af33462ef Fix code generation for Array<C> element access where C is inline class 2018-08-13 08:49:04 +03:00
Alexander Udalov 76214930da Update generic signatures in codegen test data
The implementation of toString for generic types in Java reflection has
been changed in 8u162 (https://bugs.openjdk.java.net/browse/JDK-8054213)
2018-08-10 18:20:05 +02:00
Mikhail Zarechenskiy b1985ee422 Enable SAM conversion for Kotlin functions by default in new inference
KT-25686
2018-08-10 17:24:18 +03:00
Dmitry Savvinov 57bafcf9e9 Do not lose information about contracts if call uses default value
It is safe to treat DefaultValueArgument as UNKNOWN_COMPUTATION, because
default arguments can't break smartcasts.

Possibly, they can add new ones, but it can be supported later.

^KT-25278 Fixed
2018-08-10 13:19:32 +03:00
Denis Zharkov 375f3c0769 Fix type-intersection-related test data
The order of types enumeration has been changed recently:
previously it was collected at first from a child and then from
its parent, but now it's being collected in order of appearance
2018-08-10 15:40:50 +07:00
Dmitry Petrov 4f6aa50417 Fix == for inline classes with boxes
TODO generalize code generating object vs primitive equality

 #KT-25914 Fixed
 #KT-25981 Fixed
 #KT-25983 Fixed
2018-08-10 10:34:57 +03:00
Roman Artemev 6c8e30eb05 Fix test failures
* add metadata
 * unmute working tests
 * mute temporary broken ones
2018-08-09 20:55:50 +03:00
Dmitry Savvinov 447c127036 Fix unsound smartcast from loop condition on assigned vars
^KT-22379 Fixed
2018-08-09 19:56:23 +03:00
Mikhael Bogdanov a7d706f693 Unmute jvm ir-tests 2018-08-09 16:30:32 +03:00