Jinseong Jeon
d53354057a
FIR: build functional type for SAM with receiver properly
2021-01-12 10:33:55 +03:00
Mikhail Glukhikh
a6534c4653
[FIR] Fix completion of synthetic call arguments
2020-12-29 17:48:15 +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
Jinseong Jeon
6239301f4e
FIR: no constraint for coerced-to-Unit last expression of lambda
2020-12-15 17:52:49 +03:00
Mikhail Glukhikh
42ea4463ee
Fix type argument inconsistency in FirResolvedQualifier
2020-12-09 19:53:24 +03:00
Jinseong Jeon
fc7f589caa
FIR Java: record Java types with flexible nullability
2020-11-18 13:06:46 +03:00
Denis Zharkov
14305d1eba
FIR: Simplify callable references resolution
...
Also that fixes some bugs
2020-11-16 15:50:39 +03:00
Denis Zharkov
d4c7d4fc7c
FIR: Fix callable references resolution with stub receivers
...
Use stubReceiver as a receiver for fake calls
See issues KT-43358 KT-43359 KT-43378
2020-11-16 15:50:39 +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
Denis Zharkov
396e799e5d
FIR: Fix resolution for type-alias based SAM
2020-11-16 15:50:39 +03:00
Mikhail Glukhikh
bc47a30dd3
[FIR] Handle 'EnhancedNullability' more properly
...
This commit includes three changes:
1. 'EnhancedNullability' is no more set for declaration types
2. It is no more used for conversion types in translator
3. Translator inserts implicit not-null cast only when enhanced type is cast to not-null type.
2020-11-10 21:07:27 +03:00
Denis Zharkov
41f878e104
FIR: Adjust test data for type alias constructors
...
They are not SubstitutionOverrides anymore
2020-11-06 11:32:39 +03:00
Denis Zharkov
65119adb6a
FIR: Adjust test data. FakeOverride -> SubssitutionOverride
2020-11-06 11:32:39 +03:00
Jinseong Jeon
1f1e1828a7
FIR CFG: reconfigure exception throwing paths in try expression
2020-11-04 16:35:42 +03:00
Mikhail Glukhikh
7b4f781ea8
[FIR] Split primary constructor parameter scope into two different
...
In init block or property initializers,
for `val x` declared in primary constructor,
`x` reference is now resolved to property, not to parameter.
So we need two different scopes for primary constructor,
one for 'pure' parameters and another one for all parameters,
including val/var ones.
#KT-42844 Fixed
2020-10-30 18:44:55 +03:00
Mikhail Glukhikh
09043fb98d
[FIR] JvmMappedScope: add mutable methods or not depending on a class
2020-10-27 10:27:06 +03:00
Mikhail Glukhikh
7f3d0af4f7
[FIR Java] Soften rules for matching types for may-be-special-builtins
...
This commit is workaround for cases like
MyJavaMap<KK : Bound, V> : java.util.Map<K, V>.
After signature changing and substitution we have
MyJavaMap.get(Object) declared and MyJavaMap.get(KK) from supertype,
which can't be otherwise matched as overriding one another.
2020-10-23 08:12:16 +03:00
Mikhail Glukhikh
d3e85dbce0
[FIR] Implement replacing Object with type parameters for specials builtins
...
#KT-42601 Fixed
2020-10-23 08:12:15 +03:00
Mikhail Glukhikh
ad12cc296b
[FIR] Expand type before adding equality constraint
2020-10-22 15:38:30 +03:00
Jinseong Jeon
46cc01602e
FIR2IR: add implicit NOT_NULL cast if needed
2020-10-22 10:51:20 +03:00
Victor Petukhov
84129098cb
Add equality constraints without subtyping
...
^KT-42195 Fixed
^KT-41741 Fixed
2020-10-21 21:23:13 +03:00
Jinseong Jeon
1c1e8f7beb
FIR CFG: revise edge kind between local func node and fun enter node
...
so that local function enter node can be visited by FIR CFA
#KT-42814 Fixed
2020-10-21 14:01:31 +03:00
Dmitriy Novozhilov
bf1a00c73a
[FIR] Rework resolution of declaration statuses
...
There is introduced algorithm of resolution with jumps: before
resolution of some class we resolve all status of members of its
supertypes, so we can properly determine inherited visibility
and modifiers
2020-10-21 11:53:10 +03:00
Jinseong Jeon
6fc3f7e776
FIR CFG: label edges from try-enter through finally block to exit target
2020-10-15 14:22:39 +03:00
Jinseong Jeon
43852ad7ab
FIR CFG: add edges from try/catch to finally
2020-10-15 14:22:39 +03:00
Dmitriy Novozhilov
f794ced888
[FIR] Fix incorrect cluster creating in CFG dumps
2020-10-12 11:55:05 +03:00
Dmitriy Novozhilov
5efd533f55
[FIR] Desugar unary plus and minus as part of integer literal
...
#KT-42016
2020-09-23 14:05:09 +03:00
Mikhail Glukhikh
b64b32e06b
FIR: keep captured types in substitution scope
2020-09-23 09:00:57 +03:00
Mikhail Glukhikh
0c13d3197c
[FIR] Fix non-serializable type argument at the end of resolve
2020-09-16 16:53:29 +03:00
Mikhail Glukhikh
e4aaae9ae7
FIR call completion: approximate type argument types
...
This commit removes some captured / ILT types at the end of resolve
2020-09-14 18:08:28 +03:00
Dmitriy Novozhilov
def647c094
[FIR] Don't constraints for return expressions of lambda if it has Unit return type
2020-09-14 10:57:09 +03:00
Dmitriy Novozhilov
1dc3c93efa
[FIR] Don't assume types with not found symbol as error types
2020-09-11 12:13:33 +03:00
Dmitriy Novozhilov
68f3d84e22
[FIR] Use CandidateApplicability from FE 1.0
2020-09-09 12:38:34 +03:00
Mikhail Glukhikh
548adc29d0
[FIR] Enter loops in resolve using independent context
2020-09-03 14:24:31 +03:00
Dmitriy Novozhilov
b21a0213df
[NI] Get rid of FE 1.0 types in AbstractTypeApproximator
2020-08-28 10:59:51 +03:00
Arsen Nagdalian
ede1c08a9b
[FIR] Add resolution of contracts that are written using the new syntax
2020-08-25 12:58:39 +03:00
Dmitriy Novozhilov
316e0e6609
[FIR] Update testdata
2020-08-25 12:07:59 +03:00
Nick
c8f8908a01
[FIR] Add NO_THIS & INSTANCE_ACCESS_BEFORE_SUPER_CALL
2020-08-24 11:06:10 +03:00
Jinseong Jeon
ca541337d1
FIR: skip return insertion for lambda w/ Unit return type
2020-08-21 19:16:43 +03:00
Oleg Ivanov
21b8679799
[FIR] Add ReturnsImplies effect analyzer
2020-08-12 11:06:07 +03:00
Oleg Ivanov
4367d6631f
[FIR] Add CallsInPlace contract analyzer
2020-08-11 16:17:01 +03:00
Oleg Ivanov
cc9c5b9e3c
[FIR] Add CFG nodes, add multiple subGraphs for CFGOwner
2020-08-11 16:17:01 +03:00
Nick
4669e019d1
[FIR] Add diagnostic CONFLICTING_OVERLOADS & REDECLARATION
2020-08-10 10:09:37 +03:00
Dmitriy Novozhilov
721b9b4d8c
[FIR] Resolve annotations as calls
2020-08-04 08:59:14 +03:00
Mikhail Glukhikh
6eab6f2f87
[FIR TEST] Replace OTHER_ERROR with UNRESOLVED_REFERENCE in test data
2020-08-02 18:19:47 +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
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
Nick
7145caca40
[FIR] Refactor effective visibility calculation
...
Before this commit, we had effective visibility as a part of FIR status,
so it was integrated into the full pipeline. In this commit,
we introduced "effective visibility as a service" which is now used
only by exposed visibility checker. This allows us to make the thing
universal for all FIR nodes, including nodes for Java / deserialized.
2020-07-31 19:27:58 +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
Ivan Kylchik
3c01a39846
[FIR] Update test data after introducing new fir nodes
2020-07-21 13:54:17 +03:00