Commit Graph

15619 Commits

Author SHA1 Message Date
Mikhail Glukhikh 6f17a8713c Fix KT-47708 in FIR by transferring SAM annotations to synthetic constr. 2022-05-24 12:29:28 +00:00
Mikhail Glukhikh 7c89f0188a FIR: resolve conflicts around SAM calls properly 2022-05-24 12:29:27 +00:00
Ivan Kylchik 07ba9be2e0 Fix error with interpreting name of java property 2022-05-24 08:25:17 +00:00
Dmitriy Dolovov 2476d1bbb6 [IR][tests] Extend test for IR linkage issues related to functions 2022-05-24 07:48:09 +00:00
Dmitriy Novozhilov c777ecd470 [JS] Unmute tests due to fixed KT-52339 2022-05-23 12:04:37 +00:00
Victor Petukhov 7c38f99cbf [FE 1.0] Improve error message for disabled "Unit conversions" feature
^KT-49394 Fixed
2022-05-23 12:36:25 +02:00
Victor Petukhov bbf52e8b90 [FE 1.0] Make "Unit conversions" accessible experimental feature 2022-05-23 12:36:16 +02:00
Victor Petukhov 88d35067e3 [FE 1.0] Keep the same type attributes during union or intersection type attributes
^KT-51317 Fixed
2022-05-23 12:36:12 +02:00
Dmitriy Novozhilov d66748d011 [FIR] Extract expect actual matching into separate phase 2022-05-20 13:33:04 +00: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 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 be3c9ceacb FIR: Adjust FirTypeEnhancement test data 2022-05-19 16:54:02 +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 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
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 49576e0cbb Fir2Ir: handle nested class references in type parameter bounds 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 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 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 109bdb9572 Adjust tests for FirSerializeCompileKotlinAgainstKotlin 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
Dmitriy Novozhilov 89b1307e16 [FE 1.0] Don't report UNUSED_* warnings on local properties with delegate
^KT-25527 Fixed
2022-05-19 07:14:23 +00:00
Dmitriy Novozhilov 4d5a4ccd6b [FE 1.0] Don't fail on calls of functions with contracts from object
^KT-51704 Fixed
2022-05-19 07:14:22 +00:00
Ivan Kylchik 73a571ef7f Report warning from backend if constant expression cannot be evaluated 2022-05-18 21:20:04 +03:00
Ivan Kylchik 40d224d5fe Change error message of EXCEPTION_IN_CONST_VAL_INITIALIZER 2022-05-18 21:20:03 +03:00
Ivan Kylchik 001ecaa9b2 Support RENDER_DIAGNOSTICS_FULL_TEXT directive in new test infra 2022-05-18 21:20:03 +03:00
Ivan Kylchik 20d0a531df Add new tests to check evaluation of intrinsic сonsts 2022-05-18 21:20:02 +03:00
Ivan Kylchik dca22d745a Drop excessive lowerings that are replaced by ConstEvaluationLowering 2022-05-18 21:20:02 +03:00
Ivan Kylchik 0f0b48f87b Move reporting of interpreter's backend errors tests to fir module 2022-05-18 21:20:01 +03:00
Ivan Kylchik 44cf64a00c Convert const values in ranges without explicit cast 2022-05-18 21:20:01 +03:00
Ivan Kylchik 0b22cf6cb9 Rewrite ir interpreter's dump tests to box
Box tests will check the correctness of interpreter, meantime
by dumped ir we can understand that expression was folded.
2022-05-18 21:20:01 +03:00
Ivan Kylchik fac98b7787 Add possibility to dump lowered ir in tests before lowering execution 2022-05-18 21:20:00 +03:00
Ivan Kylchik 1431d4b356 Add jvm diagnostic tests to check report of exceptions from interpreter 2022-05-18 21:20:00 +03:00
Ivan Kylchik 20d8e6607d Add new diagnostic tests to check new rules for const modifier 2022-05-18 21:19:59 +03:00
Ivan Kylchik df7be06558 Add tests to check constant evaluation for intrinsic const declarations 2022-05-18 21:19:58 +03:00
Ivan Kylchik 51ccc32a3f Update test data after introducing IntrinsicConstEvaluation annotation 2022-05-18 21:19:57 +03:00
Iven Krall ba5c85d6f2 KT-35811: Type parameter angle brackets followed by equal sign are parsed incorrectly if whitespace is missing 2022-05-18 17:23:40 +00:00
Dmitriy Dolovov deb9039b0f [IR][tests] Add tests for IR linkage issues related to properties 2022-05-18 18:05:05 +03:00
Dmitriy Dolovov 8e8ecc48ad [IR][tests] Add tests for removal-of-abstract-fun IR linkage case
^KT-50771
2022-05-18 18:04:26 +03:00
Dmitriy Dolovov df909abaf5 [IR][tests] More precise IrLinkageError checks 2022-05-18 18:03:53 +03:00
Xin Wang eb1d7110ec FE: Fix null assertion error when left is CollectionLiteral
#KT-49961 fixed
2022-05-18 08:57:16 +02:00