Commit Graph

1115 Commits

Author SHA1 Message Date
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 51ccc32a3f Update test data after introducing IntrinsicConstEvaluation annotation 2022-05-18 21:19:57 +03: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 12a39d0330 [FE 1.0] Report errors due to inferred empty intersection on those candidates which were already previously discriminated by CompatibilityOfTypeVariableAsIntersectionTypePart 2022-04-27 19:50:26 +00:00
Victor Petukhov 39d13442be [FE] Support intersection type emptiness checking for interfaces 2022-04-27 19:50:25 +00:00
Victor Petukhov 5bfe6cd20a [FE] Implement discussed rules to report empty intersection errors 2022-04-27 19:50:22 +00:00
Mikhail Glukhikh 0ecba0ad0b FIR: don't create incorrect constraints in CallableReferenceResolution
#KT-50994 Fixed
Related to KT-49477
2022-04-18 14:27:42 +00:00
Ilmir Usmanov 6e30ce2763 FE: Make synchronized suspend functions and lambdas error in 1.8
#KT-27333 Fixed
2022-04-11 12:02:30 +00:00
Ilmir Usmanov f473998e8b FIR: Make 'suspend fun', where 'suspend' is not builtin error in 1.8
#KT-49264
2022-04-11 12:02:29 +00:00
Ilmir Usmanov f75a8109d2 FE 1.0: Make 'suspend fun', where 'suspend' is not builtin error in 1.8
#KT-49264 Fixed
2022-04-11 12:02:28 +00:00
Denis.Zharkov 512446843b FIR: Support typeRef-name label for this 2022-04-06 16:05:37 +00:00
Mikhail Glukhikh 9bd6a9c069 FIR: handle 'SinceKotlin' as a special kind of deprecated
#KT-51850 Fixed
2022-04-06 12:51:20 +00:00
Mikhail Glukhikh 04e8e1b2ad Move file annotation resolve a bit earlier #KT-51499 Fixed 2022-04-04 12:51:34 +00:00
Mikhail Glukhikh 899dc401c8 Add test for KT-51499 (occurs in FE10, already fixed in FIR) 2022-04-04 12:51:33 +00:00
Victor Petukhov 57a134c543 [FE 1.0] Report recursive type checker problem as a warning till 1.9
^KT-48546
2022-03-23 21:13:34 +00:00
Victor Petukhov 2307122089 [FE 1.0] Report errors for recursive types from completion as well
Such diagnostics could be missed at least for plus assignment's right side because it wasn't report for the second time of analysis

^KT-48546 Fixed
2022-03-23 21:13:34 +00:00
Victor Petukhov 27fa632630 [FE 1.0] Update test data with new error type representation 2022-03-23 21:13:33 +00:00
Dmitriy Novozhilov 6f64aedaf0 [FIR] Fix FindReferencePositioningStrategy for light tree
There was a problem which causes to lookup for assign token inside
  functions from arguments of call
2022-03-11 15:36:05 +03:00
Dmitriy Novozhilov ade2307345 [FIR] Fix exponential analysis of augmented array access calls
^KT-50861 Fixed
2022-03-11 15:36:05 +03:00
Mikhail Glukhikh c8453ec8b4 FIR: report ambiguity-like errors in type resolve 2022-03-10 20:42:42 +00:00
Simon Ogorodnik 4ba5a55626 FIR. Add visibility/deprecation filtering to type resolve 2022-03-10 20:42:39 +00:00
Mikhail Glukhikh 8c7a8edb75 Minor: add diag.txt file for label clashes diagnostic tests 2022-03-09 15:19:28 +00:00
Mikhail Glukhikh 14eec6cfc0 FE 1.0: implement typed this label resolve warning for KT-51433
#KT-51433 Fixed
2022-03-09 15:19:27 +00:00
Mikhail Glukhikh b5e2c492c6 FE 1.0: implement initial label resolve warning for KT-51433 2022-03-09 15:19:26 +00:00
Mikhail Glukhikh 53d6ac24e5 Switch kotlin version to 1.7
* Change 1.6 to 1.7 constants
* Fix SAFE_CALL_WILL_CHANGE_NULLABILITY for testData
* Change EXPOSED_PROPERTY_TYPE_IN_CONSTRUCTOR_WARNING to EXPOSED_PROPERTY_TYPE_IN_CONSTRUCTOR_ERROR
* Change NON_EXHAUSTIVE_WHEN_STATEMENT to NO_ELSE_IN_WHEN
* Fix testData for SafeCallsAreAlwaysNullable
* Change T -> T & Any in test dumps
* Change INVALID_CHARACTERS_NATIVE_WARNING -> INVALID_CHARACTERS_NATIVE_ERROR
* TYPECHECKER_HAS_RUN_INTO_RECURSIVE_PROBLEM_WARNING -> TYPECHECKER_HAS_RUN_INTO_RECURSIVE_PROBLEM_ERROR
2022-02-25 11:46:27 +00:00
Ivan Kochurkin 73b45a1254 [FIR] Report UNSUPPORTED on array literals not from annotation classes ^KT-50750 Fixed 2022-02-23 14:21:57 +03:00
Mikhail Glukhikh 6e53dd1a4b FIR: implement FE1.0-matching ILT approximation during inference
#KT-51357 Fixed
2022-02-17 15:04:37 +00:00
Mikhail Glukhikh 4902e517d3 FIR: add test for KT-51357 2022-02-17 15:04:36 +00:00
Vladimir Dolzhenko 918a91dbdf Escape special names with backticks in test data
#KT-51248
2022-02-10 21:20:47 +00:00
Mikhail Glukhikh c2f43dd98e Revert OPT_IN_MARKER_ON_OVERRIDE limitation #KT-48890 Fixed 2022-01-28 13:40:35 +00:00
Mikhail Glukhikh e8be9d4861 FIR: support don't use builder inference if possible
In this commit we upgrade FIR builder inference logic from
the compiler version to 1.7. FIR-based compiler now works with
"don't use builder inference" flag always ON and supports switching
the flag "use builder inference only if needed". To do it,
ContraintSystemCompleter (FIR) and KotlinConstraintSystemCompleter (FE 1.0)
are made similar with extracting some common parts into
ConstraintSystemCompletionContext.

Test status: one BB test fails after this commit (KT-49285).
Also we have a crush in DFA logic in FIR bootstrap test and somehow
questionable behavior in FIR diagnostic test. However,
two BB tests were fixed, the 3rd case from KT-49925 were also fixed.

#KT-49925 Fixed
2022-01-20 23:46:36 +03: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
Dmitriy Novozhilov c80cfb0fdb [FIR] Replace single supertype scope with list of scopes of supertypes in use site scopes
This big refactoring is needed to cleanup building of overrides
  mappings and prevent creating redundant intersection overrides in
  cases when there is no need in them:

```kotlin
interface A {
    fun foo()
}

interface B {
    fun foo()
}

interface C : A, B {
    override fun foo()
}
```

Before this refactoring there was next override tree:
C.foo
  intersection override (A.foo, B.foo)
    A.foo
    B.foo

Also this commit fixes special mapping of overrides in jvm scopes
  for declarations which have kotlin builtins in supertypes with
  special java mapping rules (collections, for example)
2022-01-19 15:24:43 +03:00
Victor Petukhov 72a78eb423 Replace errors with warnings for type checker recursion on delegates
^KT-49477 Fixed
2022-01-17 21:27:14 +03:00
Denis.Zharkov a33d9df0cd NI: Support forking inference with heuristics
Mostly, it only affects FIR

It partially allows to consider several variance of constraints like
A<Int> & A<T> <: A<X_var> that are mostly brought by smart casts

^KT-49542 Fixed
^KT-50489 Relates
2022-01-11 20:45:55 +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 Kylchik 6fc56477bf Drop all tests that disable features for language version less than 3 2021-12-28 20:08:56 +03:00
Mikhail Glukhikh 0739925869 Drop QUALIFIED_SUPERTYPE_EXTENDED_BY_OTHER_SUPERTYPE diagnostic in 1.7.0
#KT-49016 Fixed
2021-12-23 17:45:49 +03:00
Mikhael Bogdanov 7e99ba30f3 Remove obsolete USAGE_OF_JVM_DEFAULT_THROUGH_SUPER_CALL diagnostic
#KT-47000
2021-12-09 11:30:06 +01:00
Mikhail Glukhikh 533e802c8d FIR: support JVM_DEFAULT_WITH_COMPATIBILITY_* diagnostics (FE 1.0 sync) 2021-12-09 13:26:40 +03:00
Mikhail Glukhikh 178290eac3 FIR: drop JVM_DEFAULT_THROUGH_INHERITANCE diagnostic (FE 1.0 sync) 2021-12-09 13:26:39 +03:00
Mikhael Bogdanov a2395ec8bb Additional diagnostics for @JvmDefaultWithCompatibility 2021-12-06 14:20:25 +01:00
Mikhael Bogdanov c0ffbe03c6 Remove '-Xjvm-default-allow-non-default-inheritance' flag. Enable such inheritance by default
#KT-47000 Fixed
2021-12-03 06:39:38 +01:00
Sergej Jaskiewicz 599f705842 [stdlib] Make @LowPriorityInOverloadResolution applicable to ctors 2021-12-02 12:39:40 +00:00
Denis.Zharkov 7eb758fab1 FIR: Avoid propagation of @Exact annotation through elvis 2021-11-26 19:39:52 +03:00
Denis.Zharkov 883b18a0c6 FIR: Preserve non-custom attributes after substitution
The test is being fixed since synthetic call for elvis has @Exact-attribute on return type
2021-11-26 19:39:45 +03:00
Dmitriy Novozhilov 330574cab6 [FIR] Properly support smartcasts on stable when subjects in when conditions
^KT-49860 Fixed
2021-11-26 11:26:21 +03:00
Dmitriy Novozhilov 8707be51c9 [FIR] Report errors about invisible types from type resolution 2021-11-26 11:26:17 +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