Commit Graph

444 Commits

Author SHA1 Message Date
Dmitriy Novozhilov b99efb9a2b [NI] Look for type variables in captured flexible types
#KT-32434 Fixed
2019-07-22 11:08:39 +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
victor.petukhov 6a679d86ab Support non-parenthesized annotations on functional types without receiver
^KT-31734 Fixed
2019-07-17 16:18:15 +03:00
Mikhail Glukhikh 7ccf21c5c8 FIR resolve: fix vararg parameter types 2019-07-17 10:45:07 +03:00
Mikhail Glukhikh 592cf4f4e8 Make FirNamedReferenceWithCandidate not resolved, fix receiver completion
Counting it as resolved provokes a lot of difficult to discover errors
2019-07-17 10:45:06 +03:00
Mikhail Glukhikh 08f44d4f14 FIR resolve: add early protection against cyclic property resolve 2019-07-17 10:45:06 +03:00
Simon Ogorodnik 1222449dc8 FIR resolve: perform inference completion for property access 2019-07-17 10:45:06 +03:00
Mikhail Glukhikh 99680a2ad7 FIR: refactor & simplify invoke resolve a bit 2019-07-17 10:45:06 +03:00
Mikhail Glukhikh fff954ed3f FIR: skip extra non-valid groups during candidate resolve 2019-07-17 10:45:06 +03:00
Mikhail Glukhikh b813f22cfe Extract part of utility FIR transformers into TransformUtils 2019-07-17 10:45:05 +03:00
Mikhail Glukhikh 0ac23eef93 Minor (FIR resolve): replace session with fileSession 2019-07-17 10:45:05 +03:00
Simon Ogorodnik 3da11cc85b Use no-op substitutor instead of substitutor with empty map 2019-07-17 10:45:05 +03:00
Mikhail Glukhikh 2d74dac4f2 FIR: set constructor parameter scope correctly for designated transformer 2019-07-17 10:45:05 +03:00
Mikhail Glukhikh 2ceffa241b FIR: make Java default constructor visibility same with class visibility 2019-07-11 12:38:53 +03:00
Mikhail Glukhikh c35d7eab70 Refactor FIR symbols to make them and their FIR element types more clear
This commit also fixes work with Java synthetic properties
2019-07-11 12:37:32 +03:00
Simon Ogorodnik dfd0042a5b Do not create single element list if only one candidate 2019-07-08 16:59:50 +03:00
Mikhail Glukhikh f434248cb7 FIR property getter: take return type from property even if it's error 2019-07-08 16:59:45 +03:00
Mikhail Glukhikh d96c66adac FIR: partially implement invoke resolution 2019-07-08 16:59:37 +03:00
Mikhail Zarechenskiy 6eefea6715 Add tests for obsolete issues
#KT-32395 Obsolete (fixed in 42a5c488)
 #KT-32388 Obsolete (fixed in f3e4c9cd)
 #KT-32271 Obsolete (fixed in 60a0cf1)
2019-07-06 10:06:04 +03:00
Mikhail Zarechenskiy 515e666733 [NI] Fix exception on incomplete try/catch block
There was an inconsistency on creating PSI call and corresponding
 descriptor. See variable `catchBlocks` from visitor, it's created
 only if PSI elements are not null, but for descriptor parameters
 there wasn't such check

 #KT-32134 Fixed
 #EA-139748 Fixed
2019-07-01 12:59:37 +03:00
Alexander Udalov cf6ff8c6b3 Simplify implementation of TypeSystemCommonSuperTypesContext.typeDepth 2019-06-27 16:43:07 +02:00
Alexander Udalov 331f0291ce Minor, remove TypeSystemContext.isNotNullNothing
Use equivalent isNothing instead
2019-06-27 16:43:07 +02:00
Alexander Udalov c452934f5b Pull isNullableType and related extensions up into TypeSystemContext 2019-06-27 16:43:07 +02:00
Mikhail Zarechenskiy c77f18fbe6 [NI] Support callable references on qualified types with generics
#KT-32154 Fixed
2019-06-26 00:23:12 +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 a26cf86af7 [NI] Fix exception: callable reference is used with an unresolved LHS
#KT-32187 Fixed
2019-06-25 14:09:38 +03:00
Mikhail Zarechenskiy bc0773b219 [NI] Capture receiver of invoke-based call
#KT-32133 Fixed
2019-06-25 14:09:34 +03:00
Nikolay Krasko beb1bc09d4 Update to 192.5118.30 2019-06-25 11:48:59 +03:00
Simon Ogorodnik 9d4fbf8cbd FIR: reuse scopeSession in call resolver & implicit typed ref resolution 2019-06-24 18:51:15 +03:00
Simon Ogorodnik bc7c822b74 FIR resolve: stop visiting receiver hierarchy during call completion 2019-06-24 18:51:14 +03:00
Mikhail Glukhikh d41c50d6cf FIR: support type inference for assignments, fix related lambda inference 2019-06-24 18:51:03 +03:00
Mikhail Glukhikh 48cea4b800 FIR: take expected type into account during inference
NB: this commit provokes some inference problems,
which are fixed by next commit about type inference for assignments
2019-06-24 18:42:52 +03:00
Mikhail Glukhikh 1e1f4d4472 ConeTypeContext: handle "recursive type alias" situation 2019-06-24 18:42:51 +03:00
Mikhail Glukhikh 152abbfb4c ConeTypeContext: handle star projection more correctly
See substitutionSupertypePolicy & testInnerTP in FIR smoke diagnostics
2019-06-24 18:42:29 +03:00
Mikhail Glukhikh ac730a693a FIR: don't count implicit built-in type as a kind of implicit type
Before this commit, implicit Unit type for function with body and
without type, implicit Boolean type for conditions etc. were 'implicit'
types and resolved types together.
Sometimes this could lead to hard-to-find issues in FIR resolve, because
'implicit' types are usually handled there as 'necessary to resolve'
which is wrong for such effectively-resolved types.
2019-06-24 10:13:26 +03:00
Mikhail Zarechenskiy f3e4c9cdb3 [NI] Don't avoid Nothing-like constraints if Nothing was in initial type
#KT-32081 Fixed
 #KT-32951 Fixed
2019-06-21 11:52:39 +03:00
Mikhail Glukhikh 4b2175c8f8 FIR: do not resolve constructors / initializers in implicit type mode 2019-06-20 23:43:04 +03:00
Denis Zharkov bf0781d790 FIR: Implement fast path for classes subtyping 2019-06-20 15:42:42 +03:00
Mikhail Glukhikh c8003518a5 FIR: set super type reference properly 2019-06-20 15:26:40 +03:00
Mikhail Glukhikh 65d14ff097 FIR: do not try to calculate annotation call type
Annotation type is used instead
2019-06-20 15:26:40 +03:00
Mikhail Glukhikh 54078c4e9c FIR resolve: support inferring property type from getter 2019-06-20 15:26:39 +03:00
Mikhail Glukhikh 16ead49967 FIR: implement backing field references via 'field' synthetic variable 2019-06-20 15:26:39 +03:00
Mikhail Glukhikh 11620d848b FIR resolve: set property accessor return type to initializer type 2019-06-20 15:26:39 +03:00
Mikhail Glukhikh 7e2828c276 FIR: provide error type for property/variable without initializer 2019-06-20 15:26:39 +03:00
Simon Ogorodnik 2995e9fcac FIR deserializer optimization: avoid calling findKotlinClass twice
This commit influences enum entries deserialization.
In particular, now we don't deserialize enum entry members,
but deserialize its supertype correctly (see test data changes).
2019-06-19 23:04:41 +03:00
Mikhail Glukhikh f4fefa042d Optimization: directly call transformChildren on FirExpression
This is done instead of calling super transformer function,
which does the same after several redirections to other functions.
2019-06-19 22:53:24 +03:00
Mikhail Glukhikh dab6fe29b1 Optimization: make property 'FirExpression.resultType' inline 2019-06-19 22:52:20 +03:00
Mikhail Glukhikh b71de954ff Forbid manipulations with FirWrappedArgumentExpression type reference
The type of this expression is bound to the type of wrapped expression,
so it's better not to change it directly.
2019-06-19 22:51:26 +03:00
Mikhail Glukhikh b7da2f2ad8 FIR resolve: check early receivers on kotlin.* only
To provide more stable behaviour, the check introduced in the previous
commit is now applied only to extensions from kotlin.* package.
2019-06-19 22:48:52 +03:00
Mikhail Glukhikh 374b59dee3 FIR resolve: add early explicit receiver type check
Before this commit, explicit extension receiver type check was performed
during found candidates analysis (together with arguments type check etc.)
Now we do it just after candidate is found, and filter the candidate
out if explicit receiver type is inappropriate.

This commit slightly changes resolve semantics,
replacing WRONG_RECEIVER with UNRESOLVED_REFERENCE in certain situations.
However, it provides significant performance boost.
2019-06-19 22:45:15 +03:00