Commit Graph

5824 Commits

Author SHA1 Message Date
Victor Petukhov 867ad24c86 [FE] Show causing types in the INFERRED_TYPE_VARIABLE_INTO_EMPTY_INTERSECTION diagnostic 2022-05-27 15:14:24 +00:00
Victor Petukhov 6a34b184ac [FE] Introduce warnings on possible empty intersection types, and improve errors reporting in general
^KT-52361 Fixed
2022-05-27 15:14:23 +00:00
Victor Petukhov 02a430875f [FE 1.0] Don't fail candidates which were marked with compatibility resolve previously
^KT-52431 Fixed
^KT-52393 Fixed
2022-05-27 15:14:22 +00:00
Mikhail Glukhikh d7ca7e17c9 FE 10: wrap ext. receiver inlining prohibition in the language feature
See KT-52502
2022-05-27 14:55:08 +00:00
pyos fad35b95d4 FE: forbid extension calls on inline functional parameters
Extension receivers are currently implicitly noinline, and changing that
would require modifying the syntax to allow marking them noinline or
crossinline.

^KT-5837 Open
^KT-25787 Fixed
^KT-47965 Fixed
^KT-50107 Fixed
^KT-52403 Fixed
2022-05-27 14:55:07 +00:00
Victor Petukhov efa267bf86 [FE] Fix tests after rebase 2022-05-27 13:56:34 +00:00
Victor Petukhov 0199c76c06 [FE 1.0] Check callable reference return type safety during resolution
^KT-51844
^KT-52503 Fixed
2022-05-27 13:56:34 +00:00
Victor Petukhov 51551998c7 Revert "[FE 1.0] Take care callable reference candidates with recursive candidate return type"
This reverts commit d04beaa8bb49c99ceb993f3f7b32169c393b39f4.
2022-05-27 13:56:33 +00:00
Victor Petukhov 06deaed3d5 Add test for KT-50498 2022-05-27 13:56:33 +00:00
Victor Petukhov c25e07119c [FE 1.0] Skip improper constraints while determining READY_FOR_FIXATION_DECLARED_UPPER_BOUND_WITH_SELF_TYPES type variable readiness
^KT-51148 Fixed
2022-05-27 13:56:32 +00:00
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
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
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 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
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 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 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
Xin Wang eb1d7110ec FE: Fix null assertion error when left is CollectionLiteral
#KT-49961 fixed
2022-05-18 08:57:16 +02:00
Anastasia.Shadrina 292c0c4383 [FE] KT-51234 Check subtyping between context receivers 2022-05-17 15:27:27 +00:00
Anastasia.Shadrina d857142514 KT-51243 Fix parameterized contextual lambda
^KT-51243 Fixed
2022-05-17 15:27:26 +00:00
Victor Petukhov 6c994787b3 [FE 1.0] Don't expand type enhancement
Actually shallow type enhancement is primary, it's more specific

^KT-50734 Fixed
2022-05-17 07:38:26 +00:00
Artem Kobzar 6da3b3b274 fix: remove unnecessary warnings for export declarations. 2022-05-13 11:10:17 +00:00
Victor Petukhov 11eb5ce39c [FE] Check types in canHaveCommonSubtype for intersection emptiness with erasing nullability
It doesn't affect having common subtypes check but may lead to false positives

^KT-52364 Fixed
2022-05-12 15:11:27 +00:00
Victor Petukhov 9f31f074da [FE 1.0] Take care callable reference candidates with recursive candidate return type
^KT-51844 Fixed
2022-05-09 19:23:43 +00:00
Victor Petukhov ec6ec20728 [FE 1.0] Fix subtyping for captured integer literal types
^KT-50877 Fixed
2022-05-09 19:23:42 +00:00
Victor Petukhov 7675361380 [FE 1.0] Continue completion of calls inside that builder inference call postponed type variables of which has already been inferred 2022-05-09 12:38:39 +00:00
Victor Petukhov 94433a1600 [FE 1.0] Postpone turning NON_VARARG_SPREAD_WARNING into error till 1.8 to have a deprecation cycle of proper duration
^KT-48162
2022-05-08 10:49:16 +02:00
Artem Kobzar a2b40acc98 feat: add WARNING on usage top-level exportable declarations with non-consumable identifiers. 2022-05-04 11:22:57 +00:00
Mads Ager 17b5e46547 [FE1.0] Fix CFG for inline function calls in finally blocks.
The body of the InlinedLocalFunctionDeclarationInstruction was
not copied. That confuses the information on the exceptional edge
with the information on the normal edge.

^KT-52131 Fixed
2022-04-28 14:39:59 +03:00
Victor Petukhov 6c54b78574 [FE 1.0] Don't capture projections during compatibility check of supertypes to determine intersection type emptiness 2022-04-27 19:50:30 +00:00
Victor Petukhov 73be9d0a20 [FE] Don't check intersection emptiness if there were lower constraints 2022-04-27 19:50:30 +00:00
Victor Petukhov 20a8e5d742 [FE] Determine intersection type emptiness by looking at supertypes properly: substitute their type arguments 2022-04-27 19:50:29 +00:00
Victor Petukhov 54f0794ce3 [FE] Substitute erased type parameters as covariant 2022-04-27 19:50:28 +00:00
Victor Petukhov fb76d819f0 [FE] Erase type parameters of super types during intersection type emptiness check as well 2022-04-27 19:50:27 +00:00