Mikhail Zarechenskiy
bebdf6fcef
[NI] Added test for KT-32094
2019-06-21 11:52:44 +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
pyos
8cca74c932
JVM_IR: support vararg & defaults in function references
2019-06-20 22:37:56 +03:00
pyos
b45e8c7021
JVM_IR: make CallableReferenceLowering a bit shorter
2019-06-20 22:37:56 +03:00
Denis Zharkov
bf0781d790
FIR: Implement fast path for classes subtyping
2019-06-20 15:42:42 +03:00
Mikhail Glukhikh
cafe92639b
[FIR] Output total time & set passes in old FE performance test
2019-06-20 15:26:40 +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
ca401cb01d
FIR2IR: support backing field symbols from FIR, fix test data
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
Roman Artemev
88e92be091
[IR] Fix name clash between properties with the same fqn
...
Promote ABI version
2019-06-20 12:08:55 +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
b3c21d6e14
Optimize FirClassSymbol.hashCode()
2019-06-19 22:54:14 +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
688c2cf74f
Optimization: make FIR expression an abstract class
...
NB: this commit does significant fir:tree refactoring.
It provides some boost due to faster abstract class dispatching in JVM.
2019-06-19 22:52:44 +03:00
Mikhail Glukhikh
dab6fe29b1
Optimization: make property 'FirExpression.resultType' inline
2019-06-19 22:52:20 +03:00
Mikhail Glukhikh
f6f879302f
Optimization: make FirFunctionCall an abstract class
2019-06-19 22:52:13 +03:00
Mikhail Glukhikh
d85ad650d5
Optimization: make FirWrappedArgumentExpression an abstract class
2019-06-19 22:52:04 +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
Mikhail Glukhikh
d820b6ca52
More accurate messages about types in FirResolveBench
2019-06-19 22:45:14 +03:00
Alexander Podkhalyuzin
b59bd9d6a6
Faster component loading (better cache data structures)
2019-06-19 10:13:09 +02:00
Mikhail Zarechenskiy
796cdea50e
[NI] Require all proper constraints for Exact return type
...
Consider call `foo(bar())` where bar() returns some type variable `T`;
We had a contract that call `bar` can be completed without completion
of foo (type variables can be inferred from the current context) if `T`
has at least one proper lower constraint (ProperType <: T).
Indeed, new constraints can be added only as upper ones, so there is
no need to grow constraint system.
Unfortunately, we have Exact annotation that is used on return type of
elvis. Now, consider the following situation:
```
fun foo(a: Any) {}
fun bar(e: T): @Exact T
foo(bar("str"))
```
Here, because of Exact annotation, constraint with `Any`-type will be
added as an equal one => our prerequisite that there will be no new
lower constraints is false. `bar("str")` is inferred to Any in OI,
this seems conceptually wrong, but it's another topic of discussion.
In NI we can't just grow constraint system to use outer call because
of another important use-case:
```
fun <T> generic(i: Inv<T>) {}
fun test(a: Inv<*>?, b: Inv<*>) {
generic(a ?: b)
}
```
Common constraint system for these two calls can't be solved
(fundamentally) for this example, only if (a ?: b) and generic(result)
are computed separately.
So, to mitigate initial issue, we'll grow constraint system only if
there is at least one non-proper constraint.
#KT-31969 Fixed
2019-06-19 11:07:31 +03:00
Mikhail Zarechenskiy
ca997de6a7
[NI] Test data to understand changes in the next commit
...
##KT-31969 In Progress
2019-06-19 10:47:05 +03:00
Roman Artemev
50ad21e388
[IR BE] Fix symbol remapping for IrField/IrProperty
...
- Use appropriate wrapped descriptor
- Add test
2019-06-19 10:24:15 +03:00
Vladimir Dolzhenko
f11a87e0c5
Revert "Do not resolve import to get imported name"
...
This reverts commit 60c3e644
2019-06-19 09:20:28 +02:00
Mikhail Zarechenskiy
5cf7c7e5bf
[NI] Fix composite substitution for stubbed type in builder-inference
...
#KT-32038 Fixed
2019-06-18 19:38:04 +03:00
Mikhail Zarechenskiy
7df13c986e
[NI] Coerce to Unit expression in last block with explicit Unit
...
#KT-32037 Fixed
2019-06-18 19:38:02 +03:00
Alexander Podkhalyuzin
60c3e6442f
Do not resolve import to get imported name
2019-06-18 17:51:23 +02:00
Denis Zharkov
9d02fe564c
FIR: Avoid calling ClassId::asString from ConeTypeContext
2019-06-18 17:20:23 +03:00
Alexander Podkhalyuzin
c853ae49a2
Faster startup avoiding unnecessary class loading
2019-06-18 12:08:04 +02:00
Denis Zharkov
f7d0be980b
FIR: Optimize ConeTypeContext::isIntegerLiteralType
...
See ConeTypeContext::isIntegerLiteralTypeConstructor
2019-06-18 11:55:15 +03:00
Denis Zharkov
3c8ed21e59
Optimize ConstraintInjector::isMyTypeVariable
...
Do not look into the map for constructors that are not
type variables
2019-06-18 11:55:15 +03:00
Denis Zharkov
115ab38423
FIR: Optimize ConeTypeContext::captureFromArguments
2019-06-18 11:55:15 +03:00
Simon Ogorodnik
2c5bd46a97
[FIR] Handle non-kotlin class results from findKotlinClassOrContent
2019-06-18 11:36:42 +03:00
Simon Ogorodnik
2f53bd24dd
[FIR] Reorder providers to make builtins load first
2019-06-18 11:34:18 +03:00
Simon Ogorodnik
03c3469a14
[FIR] Enhance caches in providers
2019-06-18 11:33:11 +03:00
Simon Ogorodnik
f88fafea9d
[FIR] Use proper collections for override scope
2019-06-18 11:14:58 +03:00
Simon Ogorodnik
321e948eca
[FIR] Improve typing to get rid of cast
2019-06-18 11:14:57 +03:00
Simon Ogorodnik
95409b35ca
[FIR] Use abstract classes for FIR scopes
2019-06-18 11:14:56 +03:00
Simon Ogorodnik
810fa9c171
[FIR] Make session & symbolProvider abstract classes
2019-06-18 11:14:55 +03:00
Simon Ogorodnik
5a06027c53
[FIR] Avoid instanceof List in transformInplace
2019-06-18 11:14:54 +03:00
Ilya Gorbunov
95139252b7
Exclude kotlin.time.* from reduced js runtime
2019-06-18 03:59:52 +03:00
Mikhail Zarechenskiy
7749afb13e
[NI] Fix exception for type check callable reference against error type
...
#KT-32029 Fixed
#EA-145311 Fixed
2019-06-17 19:18:04 +03:00
Mikhail Zarechenskiy
8fe632f52b
[NI] Record DFI for callable reference arguments
...
#KT-31941 Fixed
2019-06-17 19:18:04 +03:00