Commit Graph

126 Commits

Author SHA1 Message Date
Victor Petukhov eff5f3a242 NI: do type checking for anonymous functions not inside a call
^KT-38890 Fixed
^KT-38439 Fixed
2020-05-19 16:29:14 +03:00
Denis Zharkov fa3b3e7a9a FIR: Fix false positive INAPPLICABLE_INFIX_MODIFIER 2020-04-21 09:48:03 +03:00
simon.ogorodnik f573719cc1 [FIR] Fix missing receiver type if anonymous function without label 2020-04-08 14:56:17 +03:00
Mikhail Glukhikh c1b9fdd2f3 Fix diagnostic test data to be consistent with FIR test data 2020-03-27 16:46:59 +03:00
Dmitriy Novozhilov a1d81aa15f [FIR-TEST] Fix diff between FIR and old FE testdata 2020-03-27 16:39:02 +03:00
Dmitriy Novozhilov 48fb279721 [FIR] Add constraint to flexible type for declared argument for java parameter 2020-03-27 10:17:12 +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
Ilya Chernikov 6356807997 Reapply "Only create descriptors for candidates with lambda args"
#KT-36247 fixed
A lot of testdata changed because significanly less (error) descriptors
are created for unresolved types, so diagnostics became different.
2020-02-14 11:41:30 +01:00
Mikhail Glukhikh 64c7ab1302 [FIR] Fix lambda resolve in independent context 2020-02-04 15:00:12 +03:00
Victor Petukhov 437a26684d NI: Prefer nullable lower bound to flexible one when substitution of type variable is performed and remember flexibility of type parameters based on flexibility of its upper bounds
^KT-32435 Fixed
2020-01-17 19:16:09 +03:00
Dmitriy Novozhilov 2536fa0cd5 [FIR-TEST] Add new testdata generated after changes in previous commit 2019-12-12 16:11:46 +03:00
victor.petukhov e246c23a46 Fix prematurely analyzing a lambda while fixing a type variable for another argument
^KT-35168 Fixed
2019-11-28 19:03:30 +03:00
Mikhail Zarechenskiy 455b9f852d [NI] Disable caching of LHS expression types for "+=" operators
New behavior was introduced in ab506c1579 which breaks compilation on IDE module (see test example) for new inference.

 Now we temporarily disable this optimisation. This is temporarily restriction which will be fixed once we'll have the same rules for lambdas completion

 #KT-34889 Open
2019-11-13 15:07:39 +03:00
Mikhail Zarechenskiy 60a0cf1fcc [NI] Fix exception: don't try to compute type depth on null type
#KT-32184 Fixed
2019-06-25 14:09:42 +03:00
Mikhail Zarechenskiy 787a8bb9bd Revert "[NI] Disable capturing/approximation type in TypeSubstitutor with enabled NI"
This reverts commit 7c4101e21c.

 #KT-31866 Fixed
 #KT-31868 Fixed
 #EA-125401 Fixed
 #KT-25290 Open
2019-06-07 12:31:38 +03:00
Dmitriy Novozhilov 7c4101e21c [NI] Disable capturing/approximation type in TypeSubstitutor with enabled NI 2019-05-29 10:35:46 +03:00
Mikhail Zarechenskiy 848640253a Revert "[NI] Disable capturing/approximation type in TypeSubstitutor with enabled NI"
This reverts commit f20ec3e0a6.
2019-05-29 01:31:28 +03:00
Dmitriy Novozhilov f20ec3e0a6 [NI] Disable capturing/approximation type in TypeSubstitutor with enabled NI
There is added a new service named `SubstitutingScopeProvider`, that
  provides factory that creates captured types and approximator for them.
  In OI they are the same as before commit, for NI they are empty, because
  that approximation interferes with NI algorithm

That service is injected into function descriptors and property descriptors
  and used for creating `SubstitutingScope` with correct services

Also there is changed time when we approximate captured types in NI
  (after all call checkers)

#KT-25290 Fixed
2019-05-28 11:18:33 +03:00
Dmitriy Novozhilov e46f552a8d [NI] Update testdata in diagnostic tests 2019-05-06 11:36:20 +03:00
Dmitriy Novozhilov 251a02f71d [NI] Fix recording type of lambda in trace 2019-05-06 11:36:08 +03:00
Mikhail Zarechenskiy 1e3db9ee7c [NI] Update test data for diagnostic tests 2019-04-25 16:19:37 +03:00
Dmitriy Novozhilov bfb13803d5 [NI] Fix reporting of overload resolution ambiguity 2019-04-19 14:46:22 +03:00
Mikhail Zarechenskiy 2fe900d915 [NI] Resolve lambda against input types from expected type
This is needed to report more precise diagnostics and fix IDE-tests

 #KT-31059 Fixed
2019-04-19 09:08:31 +03:00
Mikhail Zarechenskiy bcc8802014 [NI] Avoid constraints from expected type for effectively empty system
Expression will be checked against expected type later.

 Theoretically, this is not very good, but it aligns with the old
 inference, plus it helps avoiding multiple type mismatch diagnostics.
2019-04-17 12:55:12 +03:00
Dmitriy Novozhilov 9825984bc5 [NI] Update test data for diagnostic tests 2019-03-25 12:17:27 +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
victor.petukhov 46bd5ba107 Add alphabetical sorting diagnostics with same ranges 2019-02-14 12:31:42 +03:00
Mikhail Glukhikh f3555daa60 Report UNUSED_PARAMETER on main parameter in 1.3+ #KT-26999 Fixed 2018-10-25 19:10:39 +03:00
Mikhail Zarechenskiy 9891f562cc [NI] Make subtyping algorithm more robust to error types
During subtyping/incorporation we transform types (e.g. changing nullability,
 form of the type) and, basically, we're doing this to some FIXPOINT.
 It's important that we use `KotlinType.hashCode()` to compare types, but
 for error types hashCode is a hashCode of its supertype and, for example,
 `makeNullableAsSpecified` method recreate type every time. So, we continue
 to generate new constraints and we'll never stop incorporation algorithm
2018-06-07 15:45:53 +03:00
Stanislav Erokhin 18b65e7bcf [NI] Update test data 2018-06-04 12:21:47 +03:00
Mikhail Zarechenskiy d818af5287 [NI] Don't forget to analyze whole block for last postponed expression 2017-12-19 15:11:03 +03:00
Dmitry Savvinov ea72c76a37 [NI] Testdata changes after fixes in error types 2017-12-07 12:49:56 +03:00
Mikhail Zarechenskiy 328c67b9e8 Add separate diagnostic renderer results for tests with NI 2017-11-29 02:54:30 +03:00
Mikhail Zarechenskiy 8757298994 Add diagnostics to test data from NI 2017-11-29 02:54:26 +03:00
Mikhail Zarechenskiy a71238bf94 Place !WITH_NEW_INFERENCE directive to diagnostics test data 2017-11-29 02:53:49 +03:00
baratynskiy 01883a41cb javac-wrapper: refactoring, fixes and tests 2017-08-29 18:01:36 +03:00
Mikhail Zarechenskiy f5cd8c7e4d Relax name shadowing warning on parameter names
#KT-17611 Fixed
2017-07-07 14:19:57 +03:00
Mikhail Zarechenskiy 9847278699 Report error about invalid if as expression on the if keyword
#KT-14633 Fixed
2017-06-22 14:18:11 +03:00
Derek Alexander 1f5cc059f9 Fix compiler failure related NO_EXPECTED_TYPE
Changes to turn KT-16016 into a compiler diagnostic error rather than a
stack trace

#KT-16016 Fixed
2017-06-16 15:52:09 +03:00
Mikhail Zarechenskiy 7541a3754d Move SAM constructors to synthetic scope 2017-05-05 21:30:35 +03:00
Mikhail Zarechenskiy 32f609ceee Check lambda parameter for name shadowing
#KT-5160 Fixed
2017-04-17 17:12:44 +03:00
Mikhail Glukhikh 7a53b2f4c8 Introduce UNUSED_ANONYMOUS_PARAMETER for anonymous functions
It is not reported for 1.0 language version because
renaming to _ is not possible. It has weak warning severity

So #KT-8813 Fixed
So #KT-16875 Fixed
2017-04-04 14:23:30 +03:00
Denis Zharkov 24819a079b Change resolution scope for componentX in lambda parameters
Component-functions are resolved in the same scope as the first statement of the lambda, but lambda receiver was not available

 #KT-14692 Fixed
2016-11-10 10:33:42 +03:00
Denis Zharkov 1f0293eb42 Check modifiers applicability on destructured lambda parameters
#KT-14502 Fixed
2016-10-24 18:00:02 +03:00
Denis Zharkov 51f4244980 Report UNUSED_DESTRUCTURED_PARAMETER_ENTRY
on destructured lambda parameters

 #KT-14347 Fixed
2016-10-24 10:19:25 +03:00
Denis Zharkov 4c69416f2b Report warning on unused entities that can be renamed to _
Currently it's all about lambda parameters/destructuring entries

 #KT-14347 In Progress
2016-10-24 10:19:25 +03:00
Denis Zharkov dbca310d8c Support single-underscore variable names partially
Currently only parameters of lambdas/function expressions
and destructuring entries are allowed

 #KT-3824 In Progress
 #KT-2783 In Progress
2016-10-24 10:19:25 +03:00
Valentin Kipyatkov ec51076355 DescriptorRenderer to render annotations for all types + separate option to render annotation arguments + use it in IdeDescriptorRenderers 2016-10-11 23:38:54 +03:00
Valentin Kipyatkov 8baa9ba1de No parameter names in type of lambda expression and anonymous function 2016-10-11 23:38:54 +03:00
Valentin Kipyatkov 4513f679de Fixed test data 2016-10-11 23:38:53 +03:00