Commit Graph

8770 Commits

Author SHA1 Message Date
Mikhail Zarechenskiy b48614df47 Add test for class literals on inline classes
#KT-28361 Obsolete
2018-11-22 18:10:41 +03:00
Mikhail Zarechenskiy 7a9fb3ca26 [NI] Fix coercion to Unit for explicitly specified type argument
#KT-25424 Fixed
2018-11-22 18:10:39 +03:00
Mikhail Zarechenskiy c6712ff861 [NI] Correctly compute definitely not null type for intersection one
{ T : Any? & Foo & Bar? }!! -> { T!! & Foo & Bar }

 Also, fix bug with loosing non-representative number type.
 For example, for type { Byte & SomeType } we lost type `Byte` because
 `getDefaultPrimitiveNumberType` returns null for it

 Fixes #KT-28334 for NI
2018-11-22 18:10:37 +03:00
Dmitry Petrov 7dd906db44 KT-28324 More exact startOffset for function/constructor declarations
Function/constructor declaration start offset is the start offset of the
corresponding declaration token, if available.
2018-11-22 10:09:31 +03:00
Mikhail Glukhikh 914620fd1f FIR: introduce status & status transformer (no override resolve)
So #KT-24021 Fixed
2018-11-21 18:04:15 +03:00
Mikhail Glukhikh a07b9a70f7 FIR builder: do not generate implicit types for getters 2018-11-21 18:04:14 +03:00
Mikhail Glukhikh dadc028884 FIR: support delegated types in secondary constructors
So #KT-24088 Fixed
2018-11-21 18:04:14 +03:00
Mikhail Glukhikh c06b0efdfa FIR: add implicit primary constructors, add delegated types to them
So #KT-24088 In Progress
2018-11-21 18:04:14 +03:00
Simon Ogorodnik 1c6490a1be FIR: Fix resolution of type parameter in ext property receiver
Also cleanup FirTypeResolveTransformer
2018-11-21 18:04:14 +03:00
Mikhail Glukhikh 06cb24db7c FIR builder: do various stub-based optimizations #KT-24090 Fixed 2018-11-21 18:04:13 +03:00
Mikhail Glukhikh 73235885e7 FIR: get rid of FirUnitType in default setters 2018-11-21 18:04:13 +03:00
Mikhail Glukhikh c2686872ae FIR: use implicit Unit type in setters 2018-11-21 18:04:13 +03:00
Mikhail Glukhikh bcb27f212c FIR: support resolve of implicit Unit types 2018-11-21 18:04:13 +03:00
Mikhail Glukhikh 65f1a6c041 FIR: introduce FictitiousFunctionSymbol making it not FIR-based 2018-11-21 18:04:13 +03:00
Mikhail Glukhikh 5cdf938902 FIR: temporary implementation of kotlin.FunctionX resolve 2018-11-21 18:04:12 +03:00
Mikhail Glukhikh 82ae3f8f10 FIR resolve: add nested companion scope #KT-24095 Fixed 2018-11-21 18:04:12 +03:00
Mikhail Glukhikh 98abe08056 Add Java symbol resolve in default star importing scope
Related to KT-24098
2018-11-21 18:04:12 +03:00
Mikhail Glukhikh b58e372db3 FIR: include properties from primary constructors in tree 2018-11-21 18:04:12 +03:00
Mikhail Glukhikh e2cec9125d FIR: resolve annotations on value & type parameters 2018-11-21 18:04:12 +03:00
Mikhail Glukhikh ea86c3d2b3 FIR: resolve bounds of function type arguments 2018-11-21 18:04:11 +03:00
Simon Ogorodnik 02bedeca05 FIR: introduce Java type resolve and JavaSymbolProvider #KT-24098 Fixed 2018-11-21 18:04:11 +03:00
Mikhail Glukhikh 5c53bdb142 FIR: support inline classes + render class attributes nicer 2018-11-21 18:04:11 +03:00
Mikhail Glukhikh 124c11df08 FIR: support lateinit properties 2018-11-21 18:04:11 +03:00
Mikhail Glukhikh 7279d696d2 FIR: support annotation resolve & rendering 2018-11-21 18:04:10 +03:00
Mikhail Glukhikh c31513837b FIR: fix resolve of function type & its parameters in supertype position 2018-11-21 18:04:10 +03:00
Simon Ogorodnik 6cfe935c2a FIR: Switch to | in fir resolved type renderer
Otherwise it clashed with qualified names
2018-11-21 18:04:10 +03:00
Mikhail Glukhikh cce741eef8 FIR: partial function type resolve + some rendering fixes 2018-11-21 18:04:09 +03:00
Mikhail Zarechenskiy 9d2524a790 Fix failing test because of lack of inference annotation
LINENUMBER was incremented because of added import
2018-11-20 19:36:50 +03:00
Mikhail Zarechenskiy 761cf0812b Minor: add test for obsolete issue
#KT-8050 Obsolete
2018-11-20 19:36:50 +03:00
Dmitry Petrov 3efb07bf7b Return kotlin ctor mapped to a java ctor even if java ctor is synthetic
This allows working with constructors with inline class parameters using
Kotlin reflection, as described in
https://youtrack.jetbrains.com/issue/KT-27429#focus=streamItem-27-3161148-0-0

 #KT-27913
 #KT-27429
2018-11-20 09:53:18 +03:00
Dmitry Petrov 9082f19c00 KT-25907: Use proper loop parameter type in for-in-CharSequence 2018-11-20 09:52:09 +03:00
Denis Zharkov 580d03be5f Support JvmWildcard/JvmSuppressWildcard in ultra-light classes
The idea is reusing logic from KotlinTypeMapper for that
2018-11-19 14:40:51 +03:00
Dmitry Petrov 90da274eaa KT-28054: Treat inline class constructor accessors specially 2018-11-19 09:42:03 +03:00
Mikhail Zarechenskiy 3a93cab3b6 Mark JVM specific test with TARGET_BACKEND directive
This is needed to avoid test failing for Kotlin/Native
2018-11-17 22:55:18 +03:00
Denis Zharkov aa63ad4a45 Report a warning when comparing incompatible enums
I've put `isIncompatibleEnums` to TypeIntersector because I placed
all of its usages after all of the TypeIntersector::isIntersectionEmpty ones

^KT-28225 Fixed
2018-11-16 10:36:09 +03:00
Mikhail Zarechenskiy 090d3327c0 Use wrapper class of an inline one as a result for javaClass
#KT-28185 Fixed
 #KT-28246 Open
2018-11-16 00:55:01 +03:00
Alexander Udalov 1a2579d8e8 Minor, add test for obsolete issue
#KT-21692 Obsolete
2018-11-15 20:29:34 +01:00
Igor Chevdar 2ff87ab1ce Fixed tests on IR copier 2018-11-15 19:13:06 +03:00
Roman Artemev d5acc8ff5b [JS BE] Set enclosing exception state in finally block
[Fix KT-28207]
2018-11-15 18:44:22 +03:00
Mikhail Zarechenskiy 35fb3ba096 Fix CCE when unboxed inline class receiver is passed to inline function
Initial problem is started in `capturedBoundReferenceReceiver` method
 where we assume that bound receiver is captured for usual call.

 Note that if method is inline then we don't pass actual name reference
 receiver, but pass special CAPTURED_RECEIVER_FIELD, which is then
 is used to find special instructions during inline and fold several
 instructions in `foldFieldAccessChainIfNeeded`.

 As a result, we got unboxed reference receiver for inline call, which
 caused CCE and to fix it we should box receiver one more time during
 inline

 #KT-28188 Fixed
2018-11-14 11:21:04 +03:00
Dmitry Petrov 99d8f2eb0c Support 'call' for primary value of an inline class
Getter of a primary value of an inline class belongs to the box class.
Its arguments should not be unboxed when the method is called.
However, its result might require boxing if it's an inline class value.

When we have an internal primary value, there's no getter method.
In fact, we can use box/unbox methods for inline class directly
(don't forget to box the result, it may be an inline class type value).

 #KT-26748
2018-11-14 09:57:51 +03:00
Alexander Udalov 3bfe138dbe Support KClassValue in JavaActualAnnotationArgumentExtractor
#KT-22704 Fixed
2018-11-13 19:05:14 +01:00
Alexander Udalov 49d6a7a7cb Refactor and improve code obtaining actual Java annotation parameter values
Extract Java-specific code into module 'frontend.java' and use already
existing JavaAnnotationArgument facilities to determine the default
parameter value in an actual Java annotation class.

Annotation arguments are not yet supported because to create an instance
of AnnotationValue, we need a descriptor, which is not available at this
point.

 #KT-22704 In Progress
 #KT-28077 Open
2018-11-13 19:05:14 +01:00
Ricardo Meneghin Filho c08540175b Allow expect annotations with actual typealias to Java have default arguments 2018-11-13 19:05:14 +01:00
Mikhail Zarechenskiy d28488eaed Remove WITH_UNSIGNED directive from tests
#KT-25226 Fixed
2018-11-13 11:48:32 +03:00
Alexander Udalov a2612c1eae Fix generic signature for KSuspendFunction types in bytecode
#KT-27560 Fixed
2018-11-12 18:53:23 +01:00
Mikhail Zarechenskiy 79159947a5 Coerce last value of delegated expression for inline classes
Note that this commit doesn't fix case when some inline class over
 `Any` is returned from a lambda, it'll be fixed further as part of the
 #KT-27586

 #KT-27737 Fixed
2018-11-12 14:21:24 +03:00
Mikhail Zarechenskiy a97867ccb8 Add test for obsolete issue
#KT-23531 Obsolete
2018-11-12 14:12:59 +03:00
Mikhail Zarechenskiy 021732f74a [NI] Consider type non-nullable only if it has non-null supertype
Fixes #KT-12684 for NI
2018-11-12 12:42:03 +03:00
Mikhail Zarechenskiy 20ff74a726 Fix mapping for inline classes when JvmSuppressWildcards mode is using
#KT-28097 Fixed
2018-11-12 09:36:05 +03:00