Commit Graph

171 Commits

Author SHA1 Message Date
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
Mikhail Glukhikh 99e02665b5 Add forgotten FIR test data for old FE test 2019-12-23 12:11:07 +03:00
Mikhail Zarechenskiy 3840294f44 Add tests for obsolete issues
#KT-11979 Obsolete
 #KT-12898 Obsolete
 #KT-30657 Obsolete
 #KT-28446 Obsolete
2019-12-20 12:06:20 +03:00
Dmitriy Novozhilov 7fed7a840b [NI] Update some testdata broken in NI 2019-12-20 11:17:47 +03:00
Denis Zharkov c486fa6189 NI: Report incompatible receiver of callable reference
^KT-35535 Fixed
2019-12-18 19:33:55 +03:00
Denis Zharkov dd56c3d918 NI: Fix property references overload ambiguity
^KT-35213 Fixed
2019-12-18 19:33:55 +03:00
Mikhail Glukhikh 249f72585d Fix test data in FIR old FE diagnostics test
Probably broken by 13 Dec commits of Denis Zharkov
2019-12-16 10:27:05 +03:00
Victor Petukhov 419d414681 NI: Update FIR test data after 07269661b4 2019-12-14 17:52:57 +03:00
Victor Petukhov 07269661b4 NI: Allow to resolve to functions with SAM conversion and passing array without spread as vararg (with warning)
^KT-35224 Fixed
2019-12-12 23:46:16 +03:00
Dmitriy Novozhilov 2536fa0cd5 [FIR-TEST] Add new testdata generated after changes in previous commit 2019-12-12 16:11:46 +03:00
Pavel Kirpichenkov 3de6289c6c [NI] Run completion on subatoms of error calls
Call transformer previously ran completion of argument atoms
only for non-error candidates. This led to missing diagnostics,
i.e. from collection literal resolver.

Now arguments of calls resolved to error descriptor are completed,
with exception to not found provideDelegate calls.
provideDelegate's subatoms are not completed after failure, because
it is a part of delegate competion, which does not end with
unresolved provideDelegate.
Completing after provideDelegate failure removes constraint system
from resolved arguments, which breaks resolve for get/setValue.

^KT-33592 Fixed
2019-12-03 18:19:32 +03:00
Mikhail Zarechenskiy 588218658c [NI] Fix ambiguity for extension functions with exact transient receiver 2019-10-25 16:28:40 +03:00
Pavel Kirpichenkov d886d48cf0 Record resolution results for ambiguous callable references
#KT-34282 Fixed
2019-10-23 18:52:53 +03:00
Pavel Kirpichenkov 02fc921eed Report diagnostics about callable reference resolution ambiguity
Found diagnostics were not reported before.
#KT-32862 In Progress
2019-10-22 13:50:59 +03:00
Mikhail Zarechenskiy 7472c789c6 Add tests for obsolete issues
#KT-28001 Obsolete
 #KT-30236 Obsolete
2019-09-12 12:03:01 +03:00
Mikhail Zarechenskiy 1969ad6e9d [NI] Take into account use-site variance for constraint from LHS of CR
#KT-32851 Fixed
2019-08-15 13:01:38 +03:00
Mikhail Zarechenskiy 04e57f712e [NI] Introduce feature for passing function references with defaults
Relates to KT-8834, we continue reducing differences between old and new
 inference. Note that as for `SamConversionPerArgument`, this feature
 is enabled in the compiler and not in the IDE to avoid breaking code
 for those users that already enabled new inference in the compiler
2019-08-07 15:58:36 +03:00
Dmitriy Novozhilov 58b4ab35f0 [NI] Fix passing callable references to suspend functions as functional parameter
#KT-32452
2019-07-22 11:06:19 +03:00