Commit Graph

5529 Commits

Author SHA1 Message Date
Ivan Kochurkin f046f2964b [FIR] Add PLATFORM_CLASS_MAPPED_TO_KOTLIN 2021-11-24 23:13:41 +03:00
Ivan Kochurkin 51b73bb6ae [FIR] Add REDUNDANT_NULLABLE diagnostics 2021-11-24 23:13:40 +03:00
Ivan Kochurkin 4caf3c5e83 [FIR] Add NOT_A_CLASS diagnostics 2021-11-24 23:13:40 +03:00
Ivan Kochurkin 3beb447e85 [FIR] Consider anonymous object declarations in classDeclarationsStack in transformers 2021-11-24 23:13:38 +03:00
Ivan Kochurkin 2241887b8f [FIR] Drop RESOLVED_TO_UNDERSCORE_NAMED_CATCH_PARAMETER, always resolve to UNRESOLVED_REFERENCE 2021-11-24 23:13:35 +03:00
Dmitriy Novozhilov 9807c67ae4 [FIR] Properly collect overriddens for method enhancement
If some java class has multiple supertypes then we need to collect
  overriddens from all those types directly, even if superTypeScope
  (which is FirTypeIntersectionScope in this case) returns only
  one symbol from one of this types (not intersection one)

This is needed to proper enhancement in cases when some type occurs
  multiple times in supertypes graph with different nullability
  of arguments:

class ConcurrentHashMap<K, V> : AbstractMap<K!, V!>, MutableMap<K, V>

If we try to find method `get(key: K): V` supertype scope returns
  `AbstractMap.get(key: K!): V!` (because it actually overrides
  `MutableMap(key: K): V?`), but we need to get both symbols to
  properly enhance types for `ConcurrentHashMap.remove`
2021-11-22 17:01:17 +03:00
Ilya Goncharov 24bc1fe1b4 [JS IR] Add test with extending exported interface 2021-11-22 12:40:28 +00:00
Ilya Goncharov 6f3985be47 [JS IR] Add test on frontend check with enum exportness
^KT-49754 fixed
2021-11-22 12:40:28 +00:00
Victor Petukhov a6fd14d4e6 [FE 1.0] Eliminate resolution ambiguity on inherited SAM-interfaces
^KT-17765 Fixed
2021-11-22 14:18:30 +03:00
Victor Petukhov a5c6d370dd [FE 1.0] Eliminate resolution ambiguity with external type parameters
^KT-10926 Fixed
2021-11-22 14:18:29 +03:00
Victor Petukhov 5c3835ab39 [FE 1.0] Don't use identifier in WhenMissingCase.kt if it wasn't provided
^KT-49702 Fixed
2021-11-22 10:44:06 +03:00
Victor Petukhov 42805db989 [FE 1.0] Take into account import aliases during hidden member resolution 2021-11-22 10:43:43 +03:00
Dmitriy Novozhilov da02d25278 [FE 1.0] Implement deprecation warning for private constructors of sealed classes
^KT-44866
^KT-49729 Fixed
2021-11-18 13:54:05 +03:00
Artem Kobzar d5dd35cb20 feat(@JsExport for interfaces): add ability to export interfaces in TypeScript. 2021-11-18 10:07:38 +00:00
Ivan Kylchik c7435ba760 Replace all occurrences of WITH_RUNTIME with WITH_STDLIB
We are going to deprecate `WITH_RUNTIME` directive. The main reason
behind this change is that `WITH_STDLIB` directive better describes
its meaning, specifically it will add kotlin stdlib to test's classpath.
2021-11-17 15:26:38 +03:00
Ivan Kochurkin f05436b939 [FIR] Fix false positive case of CANNOT_CHECK_FOR_ERASED
Restore CANNOT_CHECK_FOR_ERASED as error
2021-11-16 18:15:49 +03:00
Alexander Udalov 850d76f6bf Remove error on annotated types as arguments to typeOf
Instead, document that `KType.annotations` returns an empty list for
types created with `typeOf`. Annotations might be supported in the
future.

 #KT-49573 Fixed
 #KT-29919
2021-11-16 15:02:50 +01:00
Dmitriy Novozhilov 62b774b2e3 [FE 1.0] Properly report INTEGER_OPERATOR_RESOLVE_WILL_CHANGE
^KT-38895
2021-11-16 13:29:12 +03:00
Nikolay Lunyak 2fb066e261 KT-47101: Fix companion supertypes 2021-11-15 13:22:38 +00:00
zhelenskiy c1dc1f7e33 Diagnostics renamed
Signed-off-by: zhelenskiy <zhelenskiy2000@yandex.ru>
2021-11-13 12:38:45 +01:00
Ivan Kochurkin 15c83abfd8 [FIR] Throw UNCHECKED_CAST instead of NO_TYPE_ARGUMENTS_ON_RHS closer to FE 1.0 2021-11-12 15:20:48 +03:00
Ivan Kochurkin 5fda933c33 [FIR] Unify code of type unification, fix intersection types processing in FirCastDiagnosticsHelpers.kt 2021-11-12 15:20:47 +03:00
Ivan Kochurkin a509e819b5 [FIR] Revert changes related to reporting WRONG_NUMBER_OF_TYPE_ARGUMENTS for type aliases 2021-11-12 15:20:46 +03:00
Ivan Kochurkin d0a4ca199d [FIR] Add UNCHECKED_CAST
Regenerate diagnostics code
2021-11-12 15:20:45 +03:00
Ivan Kochurkin 1fbccff1bd [FIR] Rename isCastPossible to checkCasting, return CastingType instead of boolean 2021-11-12 15:20:45 +03:00
Ivan Kochurkin 2b5524b18f [FIR] Add CAST_NEVER_SUCCEEDS 2021-11-12 15:20:44 +03:00
Ivan Kochurkin 291bc74676 [FIR] Add CANNOT_CHECK_FOR_ERASED 2021-11-12 15:20:43 +03:00
Ivan Kochurkin e52a410599 [FIR] Initialize outer type parameters for local classes 2021-11-12 15:20:42 +03:00
Ivan Kochurkin 38820d3e41 [FIR] Implement WRONG_NUMBER_OF_TYPE_ARGUMENTS for top level type aliases 2021-11-12 15:20:42 +03:00
Ivan Kochurkin d4a11fc295 [FIR] Disallow bare types for nested type arguments
Detect missing WRONG_NUMBER_OF_TYPE_ARGUMENTS
2021-11-12 15:20:40 +03:00
Denis.Zharkov 6e15ee8fea FIR: Refine callable reference resolution in assignment position
synthetic_select<() -> T>(::foo) form allows to select better candidate
than synthetic_select(::foo) with expect type `() -> T`
2021-11-10 22:00:01 +03:00
Denis.Zharkov 65d7da122f FIR: Fix invalid INITIALIZER_TYPE_MISMATCH for suspend lambda 2021-11-10 22:00:01 +03:00
Denis.Zharkov 994040c91c FIR: Support invoke convention on super-qualified calls 2021-11-10 22:00:00 +03:00
Ivan Kochurkin c9ad2b3bf9 [FIR] Ignore visited super types during bypass in FirInconsistentTypeParameterHelpers
Get rid of potential exponential complexity
2021-11-10 19:07:26 +03:00
Mads Ager b79ca7d7df [FIR] Allow annotation instantiation.
This commit disables the frontend error reporting for supported cases.
2021-11-09 23:51:48 +03:00
Ilya Kirillov 348403b1f3 FIR: do not inherit external modifier from super declaration 2021-11-08 19:01:35 +01:00
Nikolay Lunyak 4a3a621196 [FIR] Add isVisible check to resolveRootPartOfQualifier 2021-11-04 15:52:11 +00:00
Denis.Zharkov 2e37ec6f0c FIR: Fix false-positive ILLEGAL_RESTRICTED_SUSPENDING_FUNCTION_CALL on invokeExtension calls 2021-11-02 19:08:27 +03:00
Denis.Zharkov 37b5237e97 FIR: Fix type alias case for callable reference resolution type 2021-11-02 19:08:26 +03:00
Ilya Goncharov 8e5fb50506 [JS IR] Fix diagnostic test on exportness of enum classes
^KT-37916 fixed
^KT-44494 fixed
2021-11-01 13:28:23 +00:00
Victor Petukhov 4118f3146b Use proper isPlaceholder check for psi type references 2021-11-01 13:03:41 +03:00
Victor Petukhov c8dea3db35 Add test for using underscored type in different positions 2021-11-01 13:03:40 +03:00
Victor Petukhov d1acb09add Report unsupported on using underscored type argument if the corresponding feature is disabled 2021-11-01 13:03:40 +03:00
Victor Petukhov 8a99aa4b42 [FIR] Don't build placeholder projection for types 2021-11-01 13:03:40 +03:00
Victor Petukhov 5508d40371 Put using underscored type arguments under a feature 2021-11-01 12:25:45 +03:00
Victor Petukhov 1073adbbf0 Report unsupported errors on annotations on underscored type arguments 2021-11-01 12:25:14 +03:00
Victor Petukhov 248c9550cd Support type annotations resolution on an underscored type argument 2021-11-01 12:25:10 +03:00
Victor Petukhov b69fb6779f Basic support of partially specified type arguments though a new underscore operator for type arguments
^KT-13394
2021-11-01 12:25:07 +03:00
Artem Kobzar 979e9f94ef feat(Escaped Identifiers): add ability to use any symbol wrapped in back ticks. 2021-10-29 17:55:59 +00:00
zhelenskiy ea10b4a781 Synchronizing by values and primitives is forbidden
Signed-off-by: zhelenskiy <zhelenskiy2000@yandex.ru>
2021-10-29 18:50:30 +02:00