Commit Graph

92638 Commits

Author SHA1 Message Date
Dmitriy Novozhilov 9d4d55b3ce [LL API] Extract expect actual matching into separate phase 2022-05-20 13:33:04 +00:00
Dmitriy Novozhilov d66748d011 [FIR] Extract expect actual matching into separate phase 2022-05-20 13:33:04 +00:00
Dmitriy Novozhilov de842817e8 [FE] Move ExpectActualCompatibility to :core:compiler.common module 2022-05-20 13:33:03 +00:00
Troels Bjerre Lund c6f63a6aa6 [K/N] Fix LLDB line number bug
The lowering that inserts explicit returns into returnable blocks uses
the character offset of the returnable block for the newly created
return statement. This is wrong, but only noticeable when the callee is
an inlined function in another file, where the statements of the block
belong to callee rather than the caller.

The fix takes the offset of the last statement in the block. In the
case the block does not contain any statements, it falls back to using
the offset of the block itself.

The test does not impose any specific stepping order, since this would
be too fragile. It only tests that LLDB does not step to empty (or fully
//-commented) lines.


Co-authored-by: Troels Lund <troels@google.com>
2022-05-20 09:43:55 +00:00
Svyatoslav Kuzmich 68ef2f3242 [Wasm] Temporary disable wasm stdlib tests
Due to incompatible bootstrap compiler.
2022-05-20 12:22:43 +03:00
Igor Yakovlev 9519d7998b [WASM] Run all std tests with d8 2022-05-20 12:22:43 +03:00
Svyatoslav Kuzmich d1c81eb6ba [Wasm] Support Wasm GC milestone 5 2022-05-20 12:22:43 +03:00
Denis.Zharkov c018270462 Support DNN types in approximator
Mostly, it's relevant to FIR since there we started loading
type parameter based types as (T & Any..T?)
2022-05-19 16:54:06 +00:00
Denis.Zharkov 9f7876efb6 FIR: Avoid potentially dangerous checks at makesSenseToBeDefinitelyNotNull
Sometimes, it might be called before type parameter bounds are initialized
or even before the symbols are bound to FIR
In such cases, we just assume it makes sense to create DNN there
2022-05-19 16:54:06 +00:00
Denis.Zharkov c766f20554 FIR: Adjust override checker to definitely-not-nullable types
^KT-52201 Related
2022-05-19 16:54:05 +00:00
Denis.Zharkov 21b86123e8 FIR: Adjust analysis test data after changes in how we load Java types
Especially, it's about types based on type parameters
2022-05-19 16:54:05 +00:00
Denis.Zharkov 9676cd26cf FIR: Adjust Fir2IrText test data 2022-05-19 16:54:04 +00:00
Denis.Zharkov 40119cb041 FIR: Fix regression-like CONFLICTING_JVM_DECLARATIONS
See the class org.ini4j.Ini used in intelliJ (derived kt class MyIni)
It contains inherited remove override with the following signature:
String remove(Object sectionName, Object optionName)

While also, from kotlin.collections.MutableMap we inherit
boolean remove(Object, Object)

And we should treat them as different methods to have correct signatures
in resulting class scope
2022-05-19 16:54:04 +00:00
Denis.Zharkov 784a911d1a FIR: Minor. Clarify some names at FirTypeIntersectionScopeContext 2022-05-19 16:54:03 +00:00
Denis.Zharkov 20847d25cc FIR: Fix applying attributes at T.withNullability 2022-05-19 16:54:03 +00:00
Denis.Zharkov 3967699430 FIR: Fix applying SAM conversion in case of DNN types
See org.jetbrains.kotlin.test.runners.codegen.FirBlackBoxCodegenTestGenerated.Sam.testPassSubtypeOfFunctionSamConversion

^KT-52152 Related
2022-05-19 16:54:03 +00:00
Denis.Zharkov d7f87e0182 FIR: Adjust analysis test data to changes in loading Java types 2022-05-19 16:54:02 +00:00
Denis.Zharkov be3c9ceacb FIR: Adjust FirTypeEnhancement test data 2022-05-19 16:54:02 +00:00
Denis.Zharkov ce1229038d Minor. Touch files erroneously not being recompiled by IC
^KT-52137 Related
2022-05-19 16:54:01 +00:00
Denis.Zharkov fb5755a0fa FIR: Refine processing special functions with erased parameters 2022-05-19 16:54:01 +00:00
Denis.Zharkov bf96abeed1 FIR: Fix special members came from superclass
class JavaSuperClass {
  // members impls with special signature, but it doesn't override any Kotlin specials
}

class KotlinInterface {
   // special members
}

class JavaSubClass extends JavaSuperClass implements KotlinInterface {
   // we should obtain members from JavaSuperClass with their Kotlinish
   // signature, not the Java one
}
2022-05-19 16:54:00 +00:00
Denis.Zharkov a0c92db819 FIR: Support DNN types during unification of bare types
See org.jetbrains.kotlin.test.runners.FirDiagnosticTestGenerated.Resolve.Types.testBareWithFlexibleArg
2022-05-19 16:54:00 +00:00
Denis.Zharkov 8a742b2574 FIR: Refine operations over OriginalProjectionTypeAttribute
It's necessary because during substitution it might be necessary to combine
attributes from the original type (this) and substitution
where OriginalProjectionTypeAttribute is actually expected to be null.

Probably, it's worth considering some kind of assertion
that `other` is always null or their projections are the same.
2022-05-19 16:53:59 +00:00
Denis.Zharkov f70ae2df3a FIR: Refine inference constraints when type variable in flexible position
That issue might be fixed via changing
TypeVariableMarker.shouldBeFlexible at ConeConstraintSystemUtilContext
but this and some other tricks have been added because of incorrect
handling of constraints where type variable has a flexible bound

^KT-51168 Fixed
2022-05-19 16:53:59 +00:00
Denis.Zharkov 853b7ec078 FIR: Use NullableAny as a default bound 2022-05-19 16:53:58 +00:00
Roman Golyshev 934b8c890e [FIR] Add temporary debug output to better understand CME on TeamCity
This commit should be reverted as soon as the reason for those
exceptions is found and fixed.

Tracking issue is KTIJ-21791
2022-05-19 13:03:34 +00:00
sebastian.sellmair d7bfa02bb3 [tooling-core] Add KotlinToolingVersionOrNull factory function 2022-05-19 12:46:04 +00:00
Georgy Bronnikov 7605494f2b Fir2Ir: provide fake file-level signatures for toplevel privates
We need to supply signatures for private declarations even when their
containing file is not known. In situations where the FirDeclaration in
question is already known (i.e. where we are never going to serach for
the declaation based on that signature), FirDeclaration itself is
sufficient as a key.
2022-05-19 12:02:44 +02:00
Georgy Bronnikov 8fd29a9fec Fir2Ir: properly compute setter type parameter bounds 2022-05-19 12:02:44 +02:00
Georgy Bronnikov 3a4b8962f9 Fir2Ir: simplify getCachedIrTypeParameter
I could not figure out the reason for the special case in that function.
Tests do not show anything useful.
2022-05-19 12:02:44 +02:00
Georgy Bronnikov e504d9faed Minor: remove unused import 2022-05-19 12:02:44 +02:00
Georgy Bronnikov 49576e0cbb Fir2Ir: handle nested class references in type parameter bounds 2022-05-19 12:02:44 +02:00
Georgy Bronnikov 9fb1a901cf Fir2Ir: handle intersection types in FirJvmMangleComputer 2022-05-19 12:02:44 +02:00
Georgy Bronnikov 12533a383e JVM_IR: mute tests for compiling against Klib
The tests fail currently because Klibs are generated by the JS backend,
and signatures differ between JVM and JS (on JVM, return types are
included in mangles for simple functions).
This leads to linkage errors.
Once signatures are reworked and harmonized between backends, the tests
will repair themselves.
2022-05-19 12:02:44 +02:00
Georgy Bronnikov a8cc3ec316 Fir2IR: introduce IdSignature?.iscomposite() 2022-05-19 12:02:44 +02:00
Georgy Bronnikov 64818c817f Fir2Ir: do generate enum constructors even when private 2022-05-19 12:02:43 +02:00
Georgy Bronnikov 32e94cc126 Fir2Ir: simplify check for fake override in createIrLazyFunction 2022-05-19 12:02:43 +02:00
Georgy Bronnikov d2781f37ad Fir2Ir: ignore private imported declarations
Code that checks for inclusion is translated from IrLazyClass.
2022-05-19 12:02:43 +02:00
Georgy Bronnikov 536bd99fe7 Fir2Ir: use class id when determining whether declaration is toplevel 2022-05-19 12:02:43 +02:00
Georgy Bronnikov 39bba7973c Fir2Ir: create file level signatures where appropriate
This is godugly code, where a flag for file level signatures is passsed
around.
An alternative would be not to create file level signatures for toplevel
private clases, since those still need unique names, at least on JVM.
But that would break binary compatibility.
Signatures are due for overhaul anyway. Hopefully this code can be
reverted at that point.
2022-05-19 12:02:43 +02:00
Georgy Bronnikov 9d4ab09b41 FIR: mute test
Getters for synthetic Java properties are generated as substituted
declarations, which leads to wrong bytecode.
2022-05-19 12:02:43 +02:00
Georgy Bronnikov dafcafc232 Fix infinite tail recursion 2022-05-19 12:02:43 +02:00
Georgy Bronnikov 870ee9c445 Fir2Ir: mute a test
FIR computes return type of testGeneric1 as T (type parameter).
Looks like a FIR bug.
2022-05-19 12:02:43 +02:00
Georgy Bronnikov 12818823b0 Fir2Ir: test data 2022-05-19 12:02:43 +02:00
Georgy Bronnikov 1eaec5a6e6 Fir2Ir: use typeContext in Fir2IrDeclarationStorage.createIrParameter 2022-05-19 12:02:43 +02:00
Georgy Bronnikov 109bdb9572 Adjust tests for FirSerializeCompileKotlinAgainstKotlin 2022-05-19 12:02:43 +02:00
Georgy Bronnikov e7b1cc03de Fir2Ir: deal with flexible and raw types in FirJvmMangleComputer and type converter 2022-05-19 12:02:43 +02:00
Georgy Bronnikov ad625a4631 Fir2Ir: deal with Java fields in FirIrProvider 2022-05-19 12:02:43 +02:00
Georgy Bronnikov 5605463ecf Introduce IGNORE_BACKEND_FIR_MULTI_MODULE directive 2022-05-19 12:02:43 +02:00
Georgy Bronnikov 571ba9298e Fir2Ir: put properties data from IrBuiltinsOverFir into symbol table
Properties themselves, accessors, backing fields.
2022-05-19 12:02:43 +02:00