Commit Graph

842 Commits

Author SHA1 Message Date
Victor Petukhov 7f7bb70596 Don't fix a type variable into the intersection type if there is an explicit expected type
^KT-43303 Fixed
^KT-42396 Fixed
^KT-42472 Fixed
2021-03-12 14:36:53 +03:00
Dmitriy Novozhilov 65ea4e184a [FIR] Fix enhancement of FlexibleNullability and EnhancedNullability
- Add utilities to add new attribute to ConeAttributes
- Get rid of FlexibleNullability attribute (it can be easily inferred
    for any flexible type at any moment)
- Fix determining of EnhancedNullability attribute
2021-03-11 13:10:04 +03:00
Dmitriy Novozhilov 74118930b4 [FE] Don't fail with exception if ESVisitor tries to visit ESLambda
#KT-45243 Fixed
2021-03-11 00:58:24 +03:00
Jinseong Jeon 6427117a35 FIR CFG: correct edge label from a node that returns Nothing
If it's not within a try/catch/finally, that should be an uncaught
exception path.

^KT-45327 Fixed
2021-03-09 14:44:42 +03:00
Jinseong Jeon d8fb54c6bd Reproduce KT-45327: false positive MUST_INITIALIZED_OR_BE_ABSTRACT after conditional exitProcess 2021-03-09 14:44:42 +03:00
Jinseong Jeon e009b71f88 FIR checker: report uninitialized member/extension properties 2021-03-04 17:56:29 +03:00
Jinseong Jeon f1fa290d49 FIR checker: report val reassignment 2021-03-03 12:27:11 +03:00
Ilmir Usmanov 62123d72e2 IC: Add inline class -> @JvmInline value class warning 2021-02-25 16:06:47 +01:00
Tianyu Geng bdeecfc188 FIR: check multiple vararg param and forbidden vararg type 2021-02-24 13:50:46 +03:00
Tianyu Geng 6b453d9b23 FIR: implement checker for open members
Specifically,

1. NON_FINAL_MEMBER_IN_FINAL_CLASS
2. NON_FINAL_MEMBER_IN_OBJECT
2021-02-19 10:17:18 +03:00
Jinseong Jeon 5f9357eb41 FIR: transform implicit type ref in anonymous function arguments & body
^KT-45010 Fixed
2021-02-19 10:17:16 +03:00
Jinseong Jeon 27c942a0ff FIR: enforce the return type of function literals without body
Its return type should be Unit, so do not use the expected type from,
e.g., parameter type.
2021-02-19 10:17:16 +03:00
Hyojae Kim 82ac482143 Fix typo (#4051)
Fix typo
2021-02-18 12:28:19 +03:00
Dmitriy Novozhilov 2b39282682 [FIR] Render original type before smartcasted type in DEBUG_INFO_EXPRESSION_TYPE
This is made for keep consistency with same renderer in FE 1.0
2021-02-16 17:51:32 +03:00
Victor Petukhov 0d40022d6d Add reporting of the warnings based on Java annotations for expanded type aliases
Before that, such warnings weren't reported as the corresponding errors were reported during type inference (only original types took part there)
2021-02-15 12:13:55 +03:00
Victor Petukhov d783d99443 Use upper bound checker for typealias expansion 2021-02-15 12:13:53 +03:00
Victor Petukhov edb8007d52 Add test for errors reporting of UPPER_BOUND_VIOLATED 2021-02-15 12:13:52 +03:00
Victor Petukhov befe8599c4 Report warnings or errors for violated type parameter's upper bounds from Java annotated with nullability annotations
^KT-43262 Fixed
2021-02-15 12:13:50 +03:00
Dmitriy Novozhilov f3a8fcaea6 [FE] Make constructors of sealed classes protected instead of internal 2021-02-12 13:36:38 +03:00
Jinseong Jeon 20f9787c70 FIR checker: report errors in contract description 2021-02-11 17:02:18 +03:00
Jinseong Jeon bd37badf29 FIR checker: add diagnostics for backing fields 2021-02-10 12:29:34 +03:00
Jinseong Jeon 83e3201677 FIR DFA: correct exit node retrieval when a safe call is the last expression
^KT-44699 Fixed
2021-02-08 13:01:11 +03:00
Jinseong Jeon 065d0c66ab FIR checker: reproduce a false alarm on type mismatch of overridden property 2021-02-08 13:01:11 +03:00
Denis.Zharkov d901ceb734 FIR: Fix loading Java annotations with Class[]-typed methods 2021-02-03 15:05:22 +03:00
Denis.Zharkov 8712772a5f FIR: Add test for type resolution when referenced nested class from supertypes 2021-02-03 15:05:22 +03:00
Denis.Zharkov e7669ef9d6 FIR: Fix builder inference case with independent calls inside lambda 2021-02-03 15:05:21 +03:00
Jinseong Jeon b48835f3ce FIR checker: fix positions of type mismatch on overrides
To handle implicit return types, those should be reported on
declarations with return type positioning strategy, instead of
return type itself.
2021-02-03 12:07:35 +03:00
Alexander Udalov d022bb0248 Switch default JVM target to 1.8
#KT-29405 Fixed
2021-02-01 11:54:04 +01:00
Mikhail Glukhikh 7d4eaefd36 FIR: report UNSAFE_CALL on dot when possible 2021-01-29 16:55:26 +03:00
Mikhail Glukhikh 0ee4f1f393 FIR: more exact nullability determination in potential UNSAFE_CALL check 2021-01-29 16:55:09 +03:00
Jinseong Jeon e72ddbcbfe FIR checker: differentiate UNSAFE_CALL from INAPPLICABLE_CANDIDATE
To do so, inside the root cause of inapplicable candidate errors,
we will record expected/actual type of receiver, if any.
That will help identifying inapplicable calls on nullable receiver.
2021-01-29 16:54:23 +03:00
Dmitriy Novozhilov f14bd87ecc [Test] Update testdata of diagnostic tests during to change language to 1.5
Mostly this commit contains changes of descriptor dump of sealed classes
  tests according to changed visibility of sealed class constructor
2021-01-28 13:19:24 +03:00
sebastian.sellmair dcda47b502 Ensure that Decompiler and IDE agree on rendered function types with parameterized annotations
findDecompiledDeclaration.kt: Use same DescriptorRenderer options as Decompiler

DescriptorRendererImpl.kt: not enforce different AnnotationArgumentsRenderingPolicy for function type annotations

This will fix KTIJ-563 where rendered Descriptors are used as Keys
for GOTO navigation into decompiled sources.

^KTIJ-563 fixed
2021-01-26 12:24:53 +00:00
Dmitriy Novozhilov 6a7cd0c811 [Test] Add ability to specify applicability of diagnostic to module or file 2021-01-22 13:51:19 +03:00
Jinseong Jeon f1d8a6e5d1 FIR checker: introduce DECLARATION_SIGNATURE_OR_DEFAULT positioning strategy
and fix CONFLICTING_OVERLOADS to use it
2021-01-21 16:06:09 +03:00
Igor Yakovlev 2e4daee1d4 [FIR] Fix invalid diagnostic fir node sites and improved invalid type parameters count diagnostic report 2021-01-21 15:20:30 +03:00
Alexander Udalov e0363788f4 Remove some remaining tests on old coroutines 2021-01-13 19:16:31 +01:00
Mikhail Glukhikh 0c0dbd6245 [FIR] Perform more accurate pre-check of candidate receiver type 2021-01-11 17:57:04 +03:00
Victor Petukhov 7ed6aae46e Fix tests after rebasing 2020-12-25 11:53:21 +03:00
Victor Petukhov 1926434b18 Report error about uninferred type parameter for some special call' subcalls 2020-12-25 11:53:14 +03:00
Dmitriy Novozhilov f597343d82 [TEST] Fix testdata 2020-12-17 00:33:17 +03:00
Dmitriy Novozhilov 416f17e5ec [TEST] Drop remaining tests of experimental coroutines 2020-12-16 19:52:31 +03:00
Dmitriy Novozhilov b44dc55109 [TD] Mute some javac tests or update their testdata
There was a refactoring of AbstractDiagnosticsTest in 9052ef06 which
  contains bug that `setupEnvironment` for AbstractDiagnosticsTestUsingJavac
  was not called, so for last year tests `UsingJavac` had no difference
  with usual diagnostics tests which causes some contradictions in test data
2020-12-16 19:52:25 +03:00
Dmitriy Novozhilov e6b5cb5216 [TD] Update diagnostics test data due to new test runners
Update includes:
- Changing syntax of `OI/`NI` tags from `<!NI;TAG!>` to `<!TAG{NI}!>`
- Fix some incorrect directives
- Change order of diagnostics in some places
- Remove ignored diagnostics from FIR test data (previously `DIAGNOSTICS` didn't work)
- Update FIR dumps in some places and add `FIR_IDENTICAL` if needed
- Replace all JAVAC_SKIP with SKIP_JAVAC directive
2020-12-16 19:52:25 +03:00
Victor Petukhov d32d0a65f0 Revert "Report warning on @JvmStatic in private companion objects"
This reverts commit 9669ab14
2020-12-16 10:24:18 +03:00
Victor Petukhov 94deddef7f Revert "Minor: cover negative cases with test +m"
This reverts commit 04a4f9cd
2020-12-16 10:24:12 +03:00
Jinseong Jeon 6239301f4e FIR: no constraint for coerced-to-Unit last expression of lambda 2020-12-15 17:52:49 +03:00
Dmitriy Novozhilov b416c669b0 [TEST] Update testdata due to dropped COMMON_COROUTINE_TEST directive 2020-12-10 01:31:04 +03:00
Denis.Zharkov 6e4f84dddf Add @SinceKotlin("1.5") on JvmRecord annotation 2020-12-09 16:47:23 +03:00
Denis.Zharkov d4de2c4dce Add check that we have JDK 15 in classpath when using @JvmRecord
^KT-43677 In Progress
2020-12-09 16:29:03 +03:00