Commit Graph

49 Commits

Author SHA1 Message Date
Nikolay Lunyak 70e98c9c2b [FIR] Report inherited java members referencing FunctionN
^KT-60000 Fixed
2023-08-10 05:14:08 +00:00
Mikhail Zarechenskiy 1df4893a43 Extract diagnostics about an unsupported case of inheritance from Java
^KT-59152
2023-06-19 15:21:32 +00:00
Brian Norman b2230327df [FIR] Refactor upper bound validation with better source element info
Attach source information to each argument of the type before expanding
to preserve information during validation. This allows errors to be
reported on the original argument during nested type alias expansion.

^KT-50798 Fixed
^KT-50703 Fixed
2023-05-25 11:24:17 +00:00
Denis.Zharkov c3ac2e44a0 Adjust test data for enabling ProhibitUsingNullableTypeParameterAgainstNotNullAnnotated
^KT-55388 Fixed
2023-05-15 10:43:19 +00:00
Vsevolod Tolstopyatov 21fe0e80ff [K2] Report CONCURRENT_HASH_MAP_CONTAINS_OPERATOR_ERROR for class hierarchies
Previously it wasn't reported in FIR for ConcurrentHashMap inheritors
because the receiver id hasn't matched CHM.contains id
Fixed by unwrapping origin of the call in case of fake overrides

^KT-55606 fixed
2023-01-17 09:46:25 +00:00
Ilya Kirillov 1bbcae5ed2 [FIR] fix resolve contract violation from scopes
We cannot call lazy resolve to STATUS phase from scopes as scopes may be accessed on a STATUS phase or earlier

^KT-54890
^KTIJ-23587 fixed
2023-01-13 21:32:51 +00:00
pyos ee6af9af5f FIR: intersect flexible type bounds separately
^KT-54522 Fixed
2023-01-04 18:29:33 +00:00
Ilya Kirillov 644d1bf0d0 [FIR] ignore tests which fail because of resolve contracts violation 2022-12-12 16:21:07 +00:00
Dmitriy Novozhilov 1b27d60307 [FIR] Support @OnlyInputTypes annotation
^KT-54807 Fixed
2022-11-22 15:46:17 +00:00
Mikhail Glukhikh fb9b1ad0dc K1: implement warning for upper bound violated in type alias constructors
Partially implements KT-47473
2022-09-15 08:51:46 +00:00
Ivan Kochurkin 6c4dafc23c Disable IgnoreNullabilityForErasedValueParameters for indefinite time, ^KT-53751 Fixed 2022-09-13 16:45:06 +00:00
Ilya Chernikov bb996c1b27 Switch kotlin version to 1.8
with appropriate fixes in testdata, tests and other
places.
2022-06-29 10:20:30 +02: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 345fdc214b [FIR] Store enhanced functions and properties in session component
Previously enhanced symbols were cached inside SignatureEnhancement,
  which is created independently for each enhancement scope. This may
  cause creation of multiple enhanced symbols for same java declaration
  in presence of multiple scope sessions (mutithread compiler, IDE,
  separate scope session for checkers)

^KT-50858 Fixed
2022-01-19 15:24:43 +03:00
Dmitriy Novozhilov 4f967ce102 [FIR] Ignore test due to KT-50858 2022-01-19 15:24:43 +03:00
Denis.Zharkov b193e708d3 FIR: Refactor checkUpperBoundViolated
There just should be a different facades for cases
A<T1, T2> and foo<T1, T2>()

Test data has changed for type alias constructors since previously,
it was working by mistake because of assumption that type alias arguments
are linearly mapped to the type parameters of the corresponding constructors

^KT-50703 Open
2022-01-11 16:27:03 +03:00
Ivan Kochurkin 5760a94ab4 [FIR] Add CONCURRENT_HASH_MAP_CONTAINS_OPERATOR 2021-09-13 20:48:58 +03:00
pyos 03304bce96 FIR: enhance Java type parameter bounds
This also fixes handling of self-recursive types.

TODO: fix jspecify/{strict,warn}Mode/Captured.fir.kt
2021-09-06 13:11:08 +03:00
Dmitriy Novozhilov d17f984edf [FE 1.0] Migrate most of warning/error pairs to DiagnosticFactoryForDeprecation 2021-08-03 00:17:33 +03:00
Dmitriy Novozhilov e316cd04b6 [FIR] Fix consistency of FE 1.0 and FIR test data 2021-07-29 19:45:56 +02:00
Victor Petukhov 95492f7370 [FE 1.0] Fix some diagnostic tests 2021-07-29 19:45:55 +02:00
Denis.Zharkov 4892ad42b9 FIR: Do not mark not found classes' based types from Java as error
The same happens in FE1.0
2021-06-24 12:17:45 +03:00
Ivan Kochurkin da15f0ffe8 [FIR] Consider fullyExpandedType instead of original type in isSubtypeForTypeMismatch, consider lookupTag in isError method 2021-06-03 18:24:36 +03:00
Denis.Zharkov ddbdfafa79 Remove OI/NI attributes from test data 2021-05-25 13:28:27 +03:00
Denis.Zharkov 2ecba6ac39 Remove WITH_NEW_INFERENCE directive from all tests
This directive anyway does not make test run twice with OI, and with NI
It only once run the test with specific settings (// LANGUAGE)
and ignores irrelevant (OI or NI tags)
2021-05-25 13:28:26 +03:00
Victor Petukhov cc1cb463b2 Remove NonStrictOnlyInputTypesChecks LF and introduce opposite – StrictOnlyInputTypesChecks, set default as strict 2021-03-29 16:17:30 +03:00
Dmitriy Novozhilov cd890d5833 [Test] Disable UNUSED_* diagnostics in tests which are not belong to contolFlowAnalysis suite 2021-03-29 16:12:29 +03:00
Victor Petukhov 731e3ebae1 Rename LV ImprovementsAroundTypeEnhancement into TypeEnhancementImprovementsInStrictMode 2021-03-26 11:03:49 +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
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 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
Mikhail Glukhikh 8884cbe415 Introduce FIR_IDENTICAL for FIR vs old frontend tests #KT-36879 Fixed 2020-03-05 09:39:40 +03:00
simon.ogorodnik 34e6649d31 [FIR] Harden check of argument type properly
Before this commit, nullable argument could match not null parameter.
Now we require also correct nullability that breaks some cases
2020-02-03 16:45:18 +03:00
Mikhail Glukhikh 5c6341b4e4 [FIR] Handle fully qualified expressions separately in tower resolver 2020-01-13 13:26:13 +03:00
Pavel Kirpichenkov 2a4e235e34 [NI] Decrease only input types check diagnostic level to warning 2020-01-10 13:05:40 +03:00
Mikhail Zarechenskiy 8871c8b4fd Migrate diagnostic tests to 1.4 2019-12-26 15:08:51 +03:00
Dmitriy Novozhilov 2536fa0cd5 [FIR-TEST] Add new testdata generated after changes in previous commit 2019-12-12 16:11:46 +03:00
Dmitriy Novozhilov e574106799 [NI] Support @OnlyInputTypes annotation. #KT-29307 fixed 2019-05-29 10:54:41 +03:00
Dmitriy Novozhilov d01b6ef900 Revert "[NI] Support @OnlyInputTypes annotation. #KT-29307 fixed"
This reverts commit 90628112
With that annotation there is complex bug that breaks build of Kotlin compiler
2019-03-18 18:53:38 +03:00
Dmitriy Novozhilov 9062811231 [NI] Support @OnlyInputTypes annotation. #KT-29307 fixed
Also KT-26698 fixed in new inference
2019-03-15 10:39:11 +03:00
victor.petukhov 30762a450a Wrap diagnostic parameters to double quotes and split by comma instead of semicolon 2019-02-14 12:31:42 +03:00
Dmitriy Novozhilov 0501a108c0 Fix tests in DiagnosticsTestWithStdLibGenerated with NI 2019-02-01 11:40:20 +03:00
Denis Zharkov a83f0e5fb7 Add diagnostic for calling ConcurrentHashMap::contains by convention
^KT-18053 Fixed
2018-12-12 15:37:50 +03:00
Denis Zharkov 7e9704e50d Prohibit inheritance of Java members containing FunctionN types
#KT-25855 Fixed
2018-09-12 09:49:25 +03:00
Denis Zharkov 24a905293f Load Java declarations which reference FunctionN as Deprecated.Error
#KT-25855 Fixed
2018-09-12 09:49:25 +03:00
Alexander Udalov 770441c212 Merge "diagnostic with Java 8" tests with general diagnostic tests 2017-08-17 13:15:18 +03:00