Commit Graph

243 Commits

Author SHA1 Message Date
Mikhail Glukhikh f3e2dbf360 [FIR2IR] Add conversion of function annotations 2020-05-08 17:30:19 +03:00
Steven Schäfer 821aca984b JVM IR: Take superQualifierSymbols into account when lowering inline classes 2020-05-07 11:44:09 +02:00
Jinseong Jeon 9a561f4a7c FIR2IR: generate synthetic members for inline class 2020-04-30 13:09:53 +03:00
Mikhail Glukhikh f98c73cb30 [FIR] Support FirMetadataSource.File in FIR2IR & serializer (KT-38156) 2020-04-28 07:35:04 +03:00
Jinseong Jeon ef09850df8 FIR2IR: set superQualifierSymbol for super call 2020-04-27 11:50:26 +03:00
Jinseong Jeon 57fe01c375 FIR2IR: populate overriddenSymbols for overriding functions
#KT-38416 Fixed
2020-04-27 11:50:24 +03:00
Dmitry Petrov 318d4d17ba KT-38337 Fix inline class value coercion in delegated members 2020-04-21 13:21:58 +03:00
Mikhail Glukhikh 96d8b0bea3 FIR: make KFunctionX derived from KFunction 2020-04-20 17:05:37 +03:00
Jinseong Jeon c26adf53dd FIR: resolve suspend lambda properly 2020-04-20 17:05:30 +03:00
Dmitriy Novozhilov 7f02d57d88 [FIR] Correctly detect super type in delegated constructor call 2020-04-17 12:37:29 +03:00
Dmitry Petrov e2ee3d1d18 Unmute passing tests 2020-04-16 09:07:35 +03:00
Steven Schäfer 74791495d7 JVM IR: Box inline classes in covariant overrides (KT-30419) 2020-04-16 09:07:35 +03:00
Mikhail Glukhikh e1c78b31a6 [FIR2IR] Convert explicit receiver in advance 2020-04-10 14:49:27 +03:00
Mikhail Glukhikh 5c758af0a6 [FIR] Use ScopeSession from resolve transformer in FIR2IR 2020-04-09 15:22:55 +03:00
Dmitry Petrov ddf7f53118 Add more tests on inline class boxing in covariant overrides 2020-04-08 19:56:26 +03:00
Dmitry Petrov 9615b20e5d Box inline class return value in lambdas (including suspend lambdas) 2020-04-08 19:56:26 +03:00
Dmitriy Novozhilov 8a2b39d647 [FIR] Add checking receivers of callable references 2020-04-08 10:38:45 +03:00
Dmitry Petrov d5ace43614 KT-37986 Force boxing of inline class returned from function reference
KT-37998 Provide KotlinType for safe call
2020-04-04 01:32:45 +03:00
Dmitry Petrov a422a12407 Minor: update testData
In BridgeTest::testFakeOverrideMisleadingImplementation,
order of generated bridges has changed slightly
(but the overall set of generated bridges remains the same).
2020-04-03 18:31:39 +03:00
Mikhail Glukhikh f374c36cd2 [FIR2IR] Generate property extension receiver references properly 2020-04-03 13:31:15 +03:00
Mikhail Glukhikh f3f7bf70f6 [FIR] Set delegate field receiver properly 2020-04-03 13:29:55 +03:00
Jinseong Jeon 3e6b38a921 [FIR] Fix type reference for 1st arg of GetClassCall 2020-04-02 12:42:50 +03:00
Mikhail Glukhikh ffc22f4190 [FIR] Unmute two passing black box tests 2020-04-02 10:28:07 +03:00
Dmitry Petrov 24b8495e00 KT-30419 Box inline classes in return types of covariant overrides
Use boxed version of an inline class in return type position for
covariant and generic-specialized overrides.

Also fixes KT-35234 and KT-31585.
2020-04-01 22:59:14 +03:00
Jinseong Jeon 078cf02c8a FIR: Provide dispatch receiver for 'field' according to property type 2020-03-30 16:57:53 +03:00
Mikhail Glukhikh 810b607a65 [FIR2IR] Provide receivers also for property callable references 2020-03-30 16:23:10 +03:00
Juan Chen d8539fdde9 [FIR2IR] Add dispatch & extension receivers to callable references 2020-03-30 16:23:10 +03:00
Jinseong Jeon de0c9a5c73 FIR: use dispatch receiver of the enclosing function if any. 2020-03-25 08:27:21 +03:00
simon.ogorodnik f83c20065d [FIR-test] Unmute passing tests, mostly fir2ir 2020-03-24 18:58:19 +03:00
Mikhail Glukhikh 0f0e5e603d [FIR2IR] Use IR built-in types, their symbols & constructors directly 2020-03-18 17:09:36 +03:00
Dmitry Petrov ade18d144a KT-36810 Implement javaPrimitiveType intrinsic in JVM_IR 2020-03-17 22:56:45 +03:00
Mikhail Glukhikh ed6c9e67a1 FIR2IR: convert qualifiers to companion objects, if any 2020-03-10 15:19:34 +03:00
Mikhail Glukhikh cfa626ad77 FIR2IR: introduce conversion scope, remove dispatch receiver for lambdas 2020-03-04 16:55:31 +03:00
Dmitry Petrov 03913ff029 KT-33119 Generate IINC for primitive types only 2020-02-28 23:20:02 +03:00
Steven Schäfer 4ac45eb38b JVM IR: Fix inline class constructors taking default values of inline class type. 2020-02-28 17:11:59 +01:00
Steven Schäfer b173284d1d Add tests for super calls in inline classes 2020-02-28 14:48:17 +01:00
Steven Schäfer 0fe8fec1d1 Mute FIR tests 2020-02-28 14:48:17 +01:00
Roman Artemev e57d34dd9e Make fix test:
- [JS IR] Unmute fixed tests
 - [IrText] Update testdata
 - [WASM] Temporary turn wasm test off
 - [FirText] Temporary turn fit text tests off
 - [JVM IR] Turn off klib jvm test
 - [IR] Add new test
2020-02-14 18:22:17 +03:00
Roman Artemev 5004bb3636 [Psi2Ir] Fix generation of hashcode for generic inline class 2020-02-14 18:22:16 +03:00
Mikhail Glukhikh 12c001f491 FIR: unmute two additional black-box tests 2020-02-11 23:14:51 +03:00
Steven Schäfer 07737f8fc6 JVM IR: Fix BridgeLowering 2020-02-07 18:44:50 +03:00
Steven Schäfer 5f6af58aeb JVM IR: (Un)mute tests and add more tests for bridge generation 2020-02-07 18:44:50 +03:00
Steven Schäfer 66cbe3b1a8 JVM IR: Remove IrReplacementFunction 2020-02-07 18:44:50 +03:00
Mikhail Zarechenskiy b7c43fc7db Refactoring: move test folder out of "inline classes" folder
It was added there by mistake
2020-01-17 19:36:08 +03:00
Mikhail Zarechenskiy 0ee977c42e FIC: Support base version of conversions in JVM backend
Proper support for JVM backend will be in the further commmits
2020-01-17 19:36:02 +03:00
Mikhail Zarechenskiy 55935cc98a FIC: introduce language feature, modifiers checks and basic tests 2020-01-17 19:36:00 +03:00
Ilya Gorbunov 0f6df5971b Mute tests failing in JS_IR backend due to KT-35944 2020-01-16 15:36:16 +03:00
Alexander Udalov 957b100cd1 JVM IR: do not generate hidden constructor for inline classes more than once
SyntheticAccessorLowering was initially implemented under the assumption
that any access to an invisible declaration will cause an accessor to be
generated _in the same file_. Moreover, it's declared in the group of
phases that are performed by file.

But this assumption is incorrect for constructors which need to be
hidden (those which take parameters of inline class types), since such
constructor is public and can be called from anywhere. In this case,
SyntheticAccessorLowering actually generated a new accessor for the
hidden constructor for each (!) source file where that constructor is
called, which led to ClassFormatError because of the class file having
multiple methods with the same signature. The internal `functionMap`
cache didn't help because it's not shared among phase instances for
different files (well, it helped to generate not more than one accessor
per usage-file).

In this change, we use the global cache, stored in JvmBackendContext,
for accessors to hidden constructors. Note that after this change, calls
to hidden constructors are always transformed to the corresponding
accessor in SyntheticAccessorLowering right away, but that accessor
might be orphaned for a while (not declared in any parent's
declarations). Only when SyntheticAccessorLowering encounters the
original constructor which needs to be hidden, it adds the accessor
beside it.

The test is sensitive to the file order, so both variants are added.
2020-01-10 13:49:05 +01:00
Juan Chen 573188bdc4 [FIR2IR]: fix translation of this references in instance methods
Currently FirThisReceiverExpression of instance methods are translated
to references of the class' thisReceiver,
not the method's dispatch receiver,
which causes problems with IrFrameMap::typeOf,
as the class' thisReceiver is not in the typeMap.

This commit translates non-qualified "this" references of
instance methods to references of the methods' dispatch receiver.
2020-01-10 10:43:07 +03:00
Mads Ager 4e4e57f60a JVM_IR: deal with inline class default values in AddContinuationLowering.
Whenever we want the default 0/null value for a type we need to
check if it is a non-nullable inline class type and produce
the right value for the underlying type.
2020-01-09 18:05:28 +01:00