Jinseong Jeon
27c942a0ff
FIR: enforce the return type of function literals without body
...
Its return type should be Unit, so do not use the expected type from,
e.g., parameter type.
2021-02-19 10:17:16 +03:00
Dmitriy Novozhilov
f3a8fcaea6
[FE] Make constructors of sealed classes protected instead of internal
2021-02-12 13:36:38 +03:00
Alexander Udalov
d022bb0248
Switch default JVM target to 1.8
...
#KT-29405 Fixed
2021-02-01 11:54:04 +01:00
Mikhail Glukhikh
0ee4f1f393
FIR: more exact nullability determination in potential UNSAFE_CALL check
2021-01-29 16:55:09 +03:00
Jinseong Jeon
e72ddbcbfe
FIR checker: differentiate UNSAFE_CALL from INAPPLICABLE_CANDIDATE
...
To do so, inside the root cause of inapplicable candidate errors,
we will record expected/actual type of receiver, if any.
That will help identifying inapplicable calls on nullable receiver.
2021-01-29 16:54:23 +03:00
Dmitriy Novozhilov
f14bd87ecc
[Test] Update testdata of diagnostic tests during to change language to 1.5
...
Mostly this commit contains changes of descriptor dump of sealed classes
tests according to changed visibility of sealed class constructor
2021-01-28 13:19:24 +03:00
Igor Yakovlev
2e4daee1d4
[FIR] Fix invalid diagnostic fir node sites and improved invalid type parameters count diagnostic report
2021-01-21 15:20:30 +03:00
pyos
29f95c7df2
FIR: improve inference of implicit type arguments in casts
...
Type parameters do not necessarily match one-to-one, or preserve order.
2021-01-18 18:01:03 +03:00
Dmitriy Novozhilov
e6b5cb5216
[TD] Update diagnostics test data due to new test runners
...
Update includes:
- Changing syntax of `OI/`NI` tags from `<!NI;TAG!>` to `<!TAG{NI}!>`
- Fix some incorrect directives
- Change order of diagnostics in some places
- Remove ignored diagnostics from FIR test data (previously `DIAGNOSTICS` didn't work)
- Update FIR dumps in some places and add `FIR_IDENTICAL` if needed
- Replace all JAVAC_SKIP with SKIP_JAVAC directive
2020-12-16 19:52:25 +03:00
Denis Zharkov
f97cc0b62d
FIR: Rework receivers processing in resolution
...
- Put extensionReceiver to candidate even if it's explicit (for sake of clarity)
- Split CheckReceiver (dispatch part should only check nullability)
2020-11-16 15:50:39 +03:00
Dmitriy Novozhilov
67b262aa34
[FIR] Move tracking candidate applicability from CheckerSink to Candidate
2020-11-11 09:52:56 +03:00
Mikhail Glukhikh
3c3aa3210e
FIR: use FROM_EXPRESSION, not FOR_SUBTYPING capt. types in substitution
2020-09-23 09:00:56 +03:00
Mikhail Glukhikh
6fd3b011ca
[FIR] Simplify substitution for unsafe-variant type parameter types
...
#KT-41792 Fixed
2020-09-14 18:08:31 +03:00
Mikhail Glukhikh
4605a65f41
[FIR] Good test data fixes (around captured types)
2020-09-14 17:56:39 +03:00
Pavel Kirpichenkov
873224dfbc
[NI] Use new type substitutor for known type parameters
...
Use known type parameters substitutor after substitutor for fresh variables.
The old logic of substituions had the following order:
- replace known type parameters
- replace type parameters with type variables
- complete inference
- replace type variables with inferred types
According to the updated logic, replacement goes as follows:
- replace type parameters with type variables
- replace known type parameters; if they were variables, this will effectively remove them from inference
- complete inference
- replace remaining type variables with inferred types
Support projection substitution in new type substitutor.
It is needed for correct interaction with old type substitutor.
Old type substitutors can contain mappings constructor -> projection
which couldn't be expressed correctly with existing substitutor API in some cases.
^KT-41386 Fixed
2020-08-31 17:53:46 +03:00
Nick
c8f8908a01
[FIR] Add NO_THIS & INSTANCE_ACCESS_BEFORE_SUPER_CALL
2020-08-24 11:06:10 +03:00
Denis Zharkov
a5a93d00a7
FIR: Rework delegation constructor calls resolution
...
Make it work independently of being called for inner class (as in FE 1.0)
2020-08-11 10:14:02 +03:00
Victor Petukhov
af48f08f9c
NI: take into account flexible types during capturing arguments from expression
...
^KT-40544 Fixed
2020-08-04 12:38:04 +03:00
Mikhail Glukhikh
951aa8185e
[FIR] Avoid duplicate diagnostics on expression.typeRef
2020-08-02 18:19:47 +03:00
Nick
4ceae8dc5e
[FIR] Don't report duplicated errors in function calls typeRefs
2020-08-02 18:19:46 +03:00
Nick
889324e972
[FIR] Ignore failing test, improve DiagnosticKind, fix UPPER_BOUND
2020-08-02 18:19:45 +03:00
Mikhail Glukhikh
ceaffb1e8b
[FIR] Don't report duplicated errors in implicit primary constructors
2020-08-02 18:19:45 +03:00
Mikhail Glukhikh
749346b73b
[FIR] Don't report duplicated errors on default accessor error type refs
2020-08-02 18:19:45 +03:00
Mikhail Glukhikh
551bdd267d
[FIR] Introduce WRONG_NUMBER_OF_TYPE_ARGUMENTS diagnostic
2020-08-02 18:19:44 +03:00
Mikhail Glukhikh
0804c6a0f3
[FIR] Introduce TYPE_ARGUMENTS_NOT_ALLOWED & some other type errors
...
This commit introduces several different things, in particular:
- check type arguments in expressions
- new TypeArgumentList node to deal with diagnostic source
- ConeDiagnostic was moved to fir:cones
- ConeIntermediateDiagnostic to use in inference (?) without reporting
- detailed diagnostics on error type
2020-08-02 18:19:44 +03:00
Dmitriy Novozhilov
f283f2db43
[FIR] Improve diagnostic reporting & don't use error symbol for candidate if possible
...
Also introduce few new diagnostics:
- NONE_APPLICABLE more many inapplicable candidates
- HIDDEN for visible candidates
2020-07-28 20:46:56 +03:00
Dmitriy Novozhilov
cedd1c133e
[FIR] Match type in super<type> access with actual supertypes of class
2020-07-20 14:38:16 +03:00
Dmitriy Novozhilov
1ce4eca3a6
[FIR] Infer type arguments for captured parameters of inner classes
...
KT-38992
2020-07-20 14:38:16 +03:00
Mikhail Zarechenskiy
8158ba2be3
Add tests for obsolete issues
...
#KT-32183 Obsolete
#KT-31474 Obsolete
#KT-31853 Obsolete
2020-07-14 11:23:57 +03:00
Denis Zharkov
72b09ff323
FIR: Rename FirSuperTypeScope and reuse it for type parameter type
...
It would allow ConeKotlinType.scope return FirTypeScope
and thus pulling down org.jetbrains.kotlin.fir.scopes.FirScope#processOverriddenFunctions
(See the following commits)
2020-06-11 11:31:31 +03:00
Victor Petukhov
379c6944a2
NI: extract diagnostics from partially resolved call instead of separately handling it including running all checks
...
^KT-37630 Fixed
^KT-35494 Fixed
2020-05-22 22:13:53 +03:00
Victor Petukhov
73dec25eb1
NI: intersect DFI types before capturing
...
^KT-37887 Fixed
2020-05-14 19:54:59 +03:00
Mikhail Glukhikh
57b4a54766
[FIR] Calculate effective visibility inside anonymous object properly
...
#KT-38432 Fixed
2020-04-23 13:57:27 +03:00
Ilya Kirillov
1a90866ce1
FIR: handle member scope for anonymous objects
...
#KT-37120 fixed
2020-04-23 10:38:41 +03:00
Mikhail Zarechenskiy
4ffcbc0c2f
[NI] Properly support UnsafeVariance annotation
...
#KT-38134 Fixed
#KT-34433 Fixed
#KT-31823 Fixed
2020-04-16 13:55:47 +03:00
simon.ogorodnik
276c393141
[FIR] Support captured type parameters in java symbol provider
2020-04-13 20:26:19 +03:00
simon.ogorodnik
0e21ac8ed2
[FIR] Apply BAD testData changes after type parameters support
2020-04-13 20:26:18 +03:00
simon.ogorodnik
132c8ee210
[FIR] Apply GOOD testData changes after type parameters support
2020-04-13 20:26:18 +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
5f9f01fe4e
[FIR] Implement new completion mode calculator
...
Note that `testDelegates` now fails due to KT-37638 and
`testSimpleIn` fails due to problems with type parameters
of inner classes
2020-03-20 23:11:28 +03:00
simon.ogorodnik
4844a90788
[FIR] KT-37453: Type argument mapping
...
#KT-37453 Fixed
2020-03-16 21:41:59 +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
Mikhail Glukhikh
8884cbe415
Introduce FIR_IDENTICAL for FIR vs old frontend tests #KT-36879 Fixed
2020-03-05 09:39:40 +03:00
simon.ogorodnik
f9483b1f4f
[FIR] KT-37027: Add 'out' projection to vararg elements
2020-02-27 19:07:17 +03:00
Denis Zharkov
c8269baa92
FIR: Fix NI handling flexible type bounds
2020-02-19 15:53:34 +03:00
Mikhail Zarechenskiy
4542f3b720
[NI] Finish analysis for coerced last lambda expressions if needed
2020-02-17 10:29:45 +03:00
Pavel Kirpichenkov
b161839092
[NI] Report unsafe implicit invoke accordingly to OI
...
This reverts commit df046683cc .
KT-30695
2020-02-14 18:06:34 +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
Pavel Kirpichenkov
df046683cc
Revert "[NI] Report unsafe implicit invoke accordingly to OI"
...
This reverts commit b045adf83a .
2020-02-13 16:06:40 +03:00
Pavel Kirpichenkov
b045adf83a
[NI] Report unsafe implicit invoke accordingly to OI
...
There are several issues with unsafe desugaring for convention calls.
Proper fix is not implemented here (see design proposal KT-30872).
This commit only applies the old logic in the new inference.
^KT-30695 Fixed
2020-02-13 14:49:43 +03:00