Commit Graph

188 Commits

Author SHA1 Message Date
Mikhail Zarechenskiy 3921a0ed70 Add test for obsolete issue
#KT-17341 Obsolete
 #KT-32958 Obsolete
2020-06-10 16:00:23 +03:00
Mikhail Zarechenskiy 718f23b34f Compatibility warning for references to companion via name (KT-13934) 2020-06-05 13:24:18 +03:00
Mikhail Zarechenskiy 47e6805186 Add compatibility warning for reference adaptation 2020-06-01 10:19:33 +03:00
Yan Zhulanow ef698a5747 Fix "PSI/index mismatch" in case of @ParameterName on non-functional types (KT-34524) 2020-05-27 02:38:41 +09:00
anastasiia.spaseeva d32aca87d1 [Spec tests] Change metadata structure of implementation and spec tests 2020-05-22 02:51:57 +03:00
Denis Zharkov e1e149a062 FIR: Support coercion-to-unit semantics for callable references 2020-05-18 11:17:45 +03:00
Victor Petukhov 260683c20e NI: Improve postponed arguments analysis
Introduce seven stages:
1) Analyze postponed arguments with fixed parameter types
2) Collect parameter types from constraints and lambda parameters' declaration
3) Fix not postponed variables for parameter types of all postponed arguments
4) Create atoms with revised expected types if needed
5) Analyze the first ready postponed argument and rerun stages if it has been analyzed
6) Force fixation remaining type variables: fix if possible or report not enough information
7) Force analysis remaining not analyzed postponed arguments and rerun stages if there are

^KT-37952 Fixed
^KT-32156 Fixed
^KT-37249 Fixed
^KT-37341 Fixed
2020-05-07 11:42:00 +03:00
Mikhail Glukhikh 96d8b0bea3 FIR: make KFunctionX derived from KFunction 2020-04-20 17:05:37 +03:00
Mikhail Zarechenskiy befa1e114c Add tests for obsolete issues
#KT-38092 Obsolete
 #KT-38179 Obsolete
 #KT-35105 Obsolete
 #KT-36696 Obsolete
 #KT-36947 Obsolete
 #KT-37337 Obsolete
 #KT-37309 Obsolete
 #KT-37727 Obsolete
 #KT-37735 Obsolete
 #KT-37853 Obsolete
 #KT-37920 Obsolete
 #KT-37709 Obsolete
 #KT-37706 Obsolete
2020-04-20 04:10:37 +03:00
Juan Chen a1e0e8b0e7 [FIR] Handle receiver types of extension methods when computing maximally specific types.
Test case (from testPrimitiveReceiver):

fun Short.foo() = 3
fun Int.foo() = 4

1::foo
2020-04-15 11:16:33 +03:00
simon.ogorodnik f573719cc1 [FIR] Fix missing receiver type if anonymous function without label 2020-04-08 14:56:17 +03:00
Dmitriy Novozhilov 8a2b39d647 [FIR] Add checking receivers of callable references 2020-04-08 10:38:45 +03:00
Denis Zharkov 9abe669443 FIR: Fix resolution for invokes on class qualifiers 2020-04-02 12:10:50 +03:00
Pavel Kirpichenkov 0abe3a6c39 [NI] Report not-a-class LHS error for callable reference arguments
^KT-37531 Fixed
2020-03-31 12:04:01 +03:00
Pavel Kirpichenkov a416fde814 [NI] Move abstract class instantiation check to call checkers
This way the check works for callable reference arguments.
Also candidate applicability during resolution does not change compared to the old inference.
^KT-37530 Fixed
2020-03-31 12:04:01 +03:00
Victor Petukhov 218c13efc5 [FIR] Remove links to spec sentences during comparison fir and old front-end test data 2020-03-30 11:15:55 +03:00
anastasiia.spaseeva 5986ffae1e [Spec tests] Add tests for expressions and statements 2020-03-30 11:15:53 +03:00
Dmitriy Novozhilov 820da6edaa [FIR] Don't set up expected type for function body 2020-03-16 17:04:28 +03:00
Victor Petukhov b1c4b5f51b NI: Analyze lambdas which are return arguments of another lambda
^KT-36044 Fixed
2020-03-12 23:29:09 +03:00
Ilya Chernikov 70c89a28e1 Stop subtyping constraint search if equality constraints for...
all not fixed type vars are found
#KT-35626 fixed
2020-03-12 08:02:45 +01:00
Dmitriy Novozhilov 770dfb69ba [FIR] Analyze all statements in block except last one in independent mode
Some broken tests will be fixed in next commit
#KT-37176 Fixed
2020-03-05 16:48:47 +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
Dmitriy Novozhilov ec01893237 [FIR] Resolve return expressions in independent context 2020-03-03 09:57:45 +03:00
simon.ogorodnik f9483b1f4f [FIR] KT-37027: Add 'out' projection to vararg elements 2020-02-27 19:07:17 +03:00
Mikhail Glukhikh ace259314b Use 'symbol' instead of 'classId' in FirResolvedQualifier
This commit solves problem with resolved qualifier of local class
#KT-36758 Fixed
2020-02-19 22:41:23 +03:00
Mikhail Glukhikh 9017654b9d [FIR] Handle default parameters when checking callable reference type
#KT-36759 Fixed
2020-02-19 18:09:06 +03:00
Victor Petukhov 51edf2b351 NI: introduce warning about implicitly inferred Nothing with existing non-Nothing expected type
^KT-35406 Fixed
2020-02-17 19:43:05 +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 Zarechenskiy 319a38bd5c [NI-MIGRATE] Update diagnostic messages 2020-02-13 11:15:59 +03:00
Denis Zharkov 5a2cdfcab4 FIR: Run callable references resolution for synthetic-select calls 2020-02-12 16:05:11 +03:00
Mikhail Glukhikh aeb6f35571 Support nullable callable references in FIR resolve 2020-02-03 16:45:19 +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 Zarechenskiy e3b6104489 [NI] Map vararg to Array if it's resolved against type variable
While this behavior is questionable, it's consistent with OI and can
 be changed in future

 #KT-36201 Fixed
2020-01-29 11:43:14 +03:00
Mikhail Glukhikh 7721eaab23 [FIR] Transform qualified access / callable refs type arguments properly 2020-01-27 00:34:17 +03:00
Mikhail Glukhikh 14204a842a Refactoring & clarification: implement new FIR tower resolver 2020-01-27 00:34:16 +03:00
Mikhail Zarechenskiy 7bd7db839d [NI] Fix adapting arguments for callable references with receivers
#KT-35912 Fixed
2020-01-23 18:56:00 +03:00
Dmitriy Novozhilov 14cf7a3d16 [NI] Add collecting forgotten type variables from callable references
#KT-35959 Fixed
2020-01-23 14:30:28 +03:00
Mikhail Glukhikh 2086c34cb9 [FIR] Fix callable references to fields / parameters / etc.
Before this commit, only references to functions & properties
were possible, now fields & parameters are also supported
2020-01-23 12:32:40 +03:00
Mikhail Glukhikh e39df5bb91 [FIR] Support type aliases in double colon expression resolver 2020-01-23 12:32:40 +03:00
Mikhail Glukhikh e644edfe84 [FIR] Handle unresolved callable references more correctly 2020-01-23 12:32:39 +03:00
Denis Zharkov 676c99b933 NI: Fix exception during callable references overload resolution
^KT-35847 Fixed
2020-01-16 10:49:49 +03:00
Denis Zharkov d4c34afb94 NI: Do not resolve static callable references on generic types
As they weren't resolved in old inference

^KT-35920 Fixed
2020-01-15 16:10:34 +03:00
Denis Zharkov c48539feb3 NI: Fix callable references resolution when LHS is generic nested class
In case of null qualifier, we should not look into any static scope
NB: factory::createCallableProcessor returns NoExplicitReceiver processor
in case of null-receiver, that makes resolving the call in the test as
`property(::key)` that matches to the property itself, thus leading to
overload resolution ambiguity

^KT-35887 Fixed
2020-01-15 16:10:34 +03:00
Dmitriy Novozhilov 88a1cb5a17 [NI] Use new type substitutor instead of old in completion of callable references
It's necessary because of new type substitutor is eager than odl, so
  if there is a substitution of type parameter deep inside type arguments
  then second substitutor wins against first

#KT-35896 Fixed
2020-01-15 14:01:25 +03:00
Mikhail Zarechenskiy 6fe61c9056 [NI] Fix ambiguity when there are no applicable candidates
#KT-35064 Fixed
2020-01-14 14:30:01 +03:00
Pavel Kirpichenkov 96c1b96f3a [NI] Report "not enough information" on callable references in lambdas
^KT-34314 Fixed
2020-01-09 20:43:15 +03:00
Mikhail Zarechenskiy 95dd322bf0 Update FIR diagnostics test 2019-12-27 14:11:47 +03:00
Denis Zharkov caf02806d5 NI: Fix resolution ambiguity for references returned from lambda
^KT-32267 Fixed
2019-12-27 11:36:19 +03:00
Mikhail Glukhikh de50f8aef3 FIR resolve: add partial support of extension lambda calls
Here we introduce ONLY_IMPLICIT_RECEIVER tower level
to support extension lambda calls on local variables,
and soften extension receiver checks to make such extensions visible & applicable.
Also here we try to map arguments twice for functional types
2019-12-27 09:57:36 +03:00
Mikhail Zarechenskiy ae1630f376 [NI] Don't discriminate Nothing-type from resulting ones
^KT-32106 Fixed
2019-12-25 14:59:04 +03:00