Commit Graph

1648 Commits

Author SHA1 Message Date
Mikhail Glukhikh f20845ba40 Get rid of FirMemberFunction 2020-02-04 15:00:09 +03:00
Mikhail Glukhikh 677129ad20 Get rid of FirNamedDeclaration 2020-02-04 15:00:08 +03:00
Mikhail Glukhikh b25d99c1e5 [FIR TEST] Add test with some problematic smart casts 2020-02-03 16:45:20 +03:00
simon.ogorodnik ca5fee77d4 [FIR] Fix generation of raw FIR for delegate with receiver 2020-02-03 16:45:20 +03:00
simon.ogorodnik ef5aab374b [FIR] Fix implicit this aliasing in DFA 2020-02-03 16:45:20 +03:00
simon.ogorodnik 645602b675 [FIR] Fix data-flow after while loops 2020-02-03 16:45:20 +03:00
Mikhail Glukhikh 91b432b4a1 [FIR] Java super-type arguments are now handled as flexible 2020-02-03 16:45:19 +03:00
Mikhail Glukhikh aeb6f35571 Support nullable callable references in FIR resolve 2020-02-03 16:45:19 +03:00
Mikhail Glukhikh a584589665 Support nullable callable references in raw FIR 2020-02-03 16:45:19 +03:00
Mikhail Glukhikh 95122f1d0b Add two more FIR problematic tests 2020-02-03 16:45:18 +03:00
Mikhail Glukhikh 0b377c103a Add FIR problematic test (safe extension invoke) 2020-02-03 16:45:18 +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
Dmitriy Novozhilov 2174556505 [FIR-TEST] Update incorrect testdata 2020-02-03 10:38:01 +03:00
Pavel Kirpichenkov 517688e163 [NI] Revise variance calculation method for completion mode
Before fix only one level of type arguments was used to determine variance of type variable to find out direction requirements.
This incorrect in general case, because outer variance affects subtyping deductions, for example:
Inv<Out<A>> <: Inv<Out<B>> => A <: B; B <: A, despite A and B are in covariant position if only one level is considered

^KT-36233 Fixed
2020-01-31 17:59:11 +03:00
Juan Chen 188abc243a [FIR] add vararg arguments support, improve vararg parameters support 2020-01-31 16:41:25 +03:00
Mads Ager e8a640851a FIR: Change the Fir2Ir handling of smart casts.
Generate the expression with the original type and then insert
an implicit conversion. That matches the behavior of psi2ir
better and therefore avoids breaking backend assumptions.

In particular, IrGetValue expects the type of the underlying
symbol and the type of the IrGetValue to be the same.
2020-01-31 09:31:52 +01:00
Denis Zharkov db6183644f FIR: Add problem test 2020-01-30 17:12:50 +03:00
Denis Zharkov 47ecaa5b06 FIR: Fix scope intersection types
Otherwise overload resolution ambiguity is reported in the test
2020-01-30 17:12:50 +03:00
Denis Zharkov d28e1f156a FIR: Fix capturing of flexible types 2020-01-30 17:12:50 +03:00
Denis Zharkov ac2b5beb4e FIR: Optimize SupertypeComputationSession::breakLoops 2020-01-30 17:12:50 +03:00
Mikhail Glukhikh 06bab6ec48 [FIR] Extract QualifierReceiver to a separate file 2020-01-30 16:28:26 +03:00
Mikhail Glukhikh 2bb5740f47 [FIR] Resolve ambiguities in Java static scopes 2020-01-30 16:28:08 +03:00
Pavel Kirpichenkov 736f5e365c [NI] Create error type for CST of error types
KT-36092 Fixed
2020-01-30 15:24:42 +03:00
Mikhail Zarechenskiy ac69c287ec [NI] Don't treat last labeled return expression in lambda specially
#KT-36251 Fixed
2020-01-30 15:11:27 +03:00
Dmitriy Novozhilov f9a4b8f9cb [FIR] Split printer in tree generator to several files
Also use smart printer instead of `PrintWriter`
2020-01-30 14:38:02 +03:00
Dmitriy Novozhilov 075068155b [FIR] Delay configuration of nodes in tree generator 2020-01-30 14:38:02 +03:00
Dmitriy Novozhilov 9f6cf5c8f4 [FIR] Add forgotten replacing lambdas in arguments of try and when calls 2020-01-30 14:38:02 +03:00
Dmitriy Novozhilov f8c8925fd6 [FIR] Support DFA analysis of postponed lambdas. Add more kinds of edges of CFG
#KT-36248
#KT-35724 Fixed
2020-01-30 14:38:02 +03:00
Dmitriy Novozhilov c78da854f7 [FIR] Make Stack an abstract class 2020-01-30 14:38:02 +03:00
Dmitriy Novozhilov 5de37baf6e [FIR] Rename EnterNode and ExitNode interface to markers 2020-01-30 14:38:01 +03:00
Dmitriy Novozhilov ec0f8a9c77 [FIR] Hide modifications of CFG from public API 2020-01-30 14:38:01 +03:00
Dmitriy Novozhilov 6716cb0bf3 [FIR] Add edge kinds to control flow graph
Another changes:
- Remove useless CFG plain text renderer
- Refactor CFG .dot renderer
- Add checking of consistency control flow graph
2020-01-30 14:38:01 +03:00
Dmitriy Novozhilov 0c2157155d [FIR-TEST] Remove outdated empty test class 2020-01-30 14:38:01 +03:00
Dmitriy Novozhilov 237198758d [FIR] Get rid of alivePreviousNodes in control flow graph 2020-01-30 14:38:01 +03:00
Dmitriy Novozhilov 1180ec54ef [FIR] Add unique id's for nodes of control flow graph 2020-01-30 14:38:01 +03:00
Pavel Kirpichenkov 832064305f [NI] Set correct applicability for unknown lambda parameter diagnostic
Unknown lambda parameter should not change resolve.
So the new diagnostic should not have error status; othrewise candidates with lower priority but more specific expected type may be chosen.

KT-34335 Fixed
See also KT-36264
2020-01-30 13:52:18 +03:00
Pavel Kirpichenkov eec039f5a2 [NI] Report error about unknown parameter type of lambda argument
KT-34335
2020-01-30 13:52:12 +03:00
Dmitry Petrov 53f66e9509 PSI2IR: SAM conversion in varargs 2020-01-30 10:27:01 +03:00
Mikhael Bogdanov 6c07dbf351 JVM_IR. Support type annotations 2020-01-29 16:59:55 +01:00
Mikhail Glukhikh 53d50c935a [FIR] Do not use strict type equality in override checker 2020-01-29 15:58:12 +03:00
Mikhail Glukhikh e43a57bdee [FIR] Do not process constructors in super-type scopes 2020-01-29 15:58:04 +03:00
Mikhail Glukhikh b4267558d7 [FIR] Fix constructors aliased importing 2020-01-29 15:57:47 +03:00
Dmitry Petrov bf9673a0a2 PSI2IR: SAM conversion should be performed once for index variables
Given esoteric code as in 'caoWithAdaptationForSam.kt', we should make
sure that we pass same objects to 'get' and 'set'.
2020-01-29 15:30:07 +03:00
Mikhail Zarechenskiy e750528551 Fix project compilation against bootstrap compiler
This is needed after e3b6104489
2020-01-29 15:25:22 +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 Zarechenskiy 35f6810b58 [NI] Do not incorporate constraints that are needed only for nullability 2020-01-29 11:43:13 +03:00
Denis Zharkov e725f255f1 FIR: Share the same ScopeSession instance between phases
^KT-34563 Fixed
2020-01-29 11:31:57 +03:00
Denis Zharkov 280fb94774 FIR: Cache file importing scopes 2020-01-29 11:31:57 +03:00
Denis Zharkov 0b2b23189a FIR: Cache default importing scopes 2020-01-29 11:31:57 +03:00
Denis Zharkov 95084a5312 FIR: Minor. Inline unused parameter in FirDefaultStarImportingScope 2020-01-29 11:31:57 +03:00