Commit Graph

2044 Commits

Author SHA1 Message Date
Dmitriy Novozhilov f748d8cf70 [FIR] Extract ResolutionContext to separate file 2020-09-09 12:38:36 +03:00
Dmitriy Novozhilov 1a84ec9677 [FIR] Mark all session components respectively to they have mutable state or not
Also add documentation for all fir annotations
2020-09-09 12:38:35 +03:00
Dmitriy Novozhilov 8686e3779e [FIR] Make all session components abstract classes 2020-09-09 12:38:35 +03:00
Dmitriy Novozhilov caf325934c [FIR] Unmake FirSamResolver as session component
It can not be stored in session because it depends on scope session
  and have mutable state
2020-09-09 12:38:35 +03:00
Dmitriy Novozhilov 29addd2a2b [FIR] Make InferenceComponents session component 2020-09-09 12:38:35 +03:00
Dmitriy Novozhilov 41b395b0aa [FIR] Extract mutable state from InferenceComponents 2020-09-09 12:38:35 +03:00
Dmitriy Novozhilov d70858edfa [FIR] Get rid of inference components in CheckerSink 2020-09-09 12:38:35 +03:00
Dmitriy Novozhilov 912676d868 [FIR] Introduce ResolutionContext and get rid of components in Candidate 2020-09-09 12:38:34 +03:00
Dmitriy Novozhilov c53ffca34f [FIR] Extract BodyResolveContext from FirAbstractBodyResolveTransformer 2020-09-09 12:38:34 +03:00
Dmitriy Novozhilov edb1273355 [FIR] Report ResolutionDiagnostics instead of applicability in resolve 2020-09-09 12:38:34 +03:00
Dmitriy Novozhilov a148db9d81 [FIR] Get rid of CandidateApplicability.SYNTHETIC_RESOLVED 2020-09-09 12:38:34 +03:00
Dmitriy Novozhilov 19707667fd [FIR] Cleanup detection that applicability is successful 2020-09-09 12:38:34 +03:00
Dmitriy Novozhilov 68f3d84e22 [FIR] Use CandidateApplicability from FE 1.0 2020-09-09 12:38:34 +03:00
Dmitriy Novozhilov d1568c1ce6 Rename ResolutionCandidateApplicability to CandidateApplicability 2020-09-09 12:38:33 +03:00
Mikhail Glukhikh db2e3f219f [FIR] Keep bare type for type alias case 2020-09-09 12:16:09 +03:00
Dmitriy Novozhilov 28a83b04cd [FIR] Minor. Fix code style 2020-09-08 12:51:13 +03:00
Dmitriy Novozhilov a05d6da43b Move descriptor-independent Visibilities to common modules 2020-09-04 11:42:50 +03:00
Mikhail Glukhikh 548adc29d0 [FIR] Enter loops in resolve using independent context 2020-09-03 14:24:31 +03:00
Mikhail Glukhikh a7da0d5080 [FIR] Approximate exotic return types for public declarations 2020-09-03 14:24:31 +03:00
Jinseong Jeon bf918e6184 FIR: hide local types if needed 2020-09-03 14:24:31 +03:00
Mikhail Glukhikh 23e83e8933 FirClassSubstitutionScope: don't recreate type parameters for unbound f/o 2020-09-03 14:24:30 +03:00
Pavel Kirpichenkov 2c816d8911 [FIR-IDE] Introduce resolver for a single candidate
The purpose of this resolver is to reuse parts of tower resolver in IDE tasks.
For now it can run resolution stages to check suitability of extension receiver.
2020-09-02 19:15:06 +03:00
Ilya Kirillov c0e9f05921 FIR: make FirTypeParameterScope to be name aware 2020-09-02 11:16:18 +03:00
Denis Zharkov 02b72e16ef FIR: Temporary weaken required phase in ensureResolvedForCalls
Currently, lazy resolution in IDE immediately starts common body resolution
after STATUS (that lead to loops during recursive resolve)
2020-09-01 17:43:30 +03:00
Denis Zharkov b0a7960b42 FIR: Call ensureResolved(TYPES) when computing supertypes of a class 2020-09-01 17:43:30 +03:00
Denis Zharkov 8427cc373f FIR: Fix coroutines related IDE exception from TowerResolveManager
Do not try to steal tasks in suspendResolverTask
Otherwise, it might lead to resuming current coroutine through
"resume" methods that is kind of illegal when using suspendCoroutineUninterceptedOrReturn
2020-09-01 17:43:30 +03:00
Denis Zharkov d532529c30 FIR: Add workaround for recursive contracts in ensureResolvedForCalls 2020-09-01 17:43:30 +03:00
Denis Zharkov 0a1440d80c FIR: Optimize ensureResolvedForCalls for common case 2020-09-01 17:43:30 +03:00
Denis Zharkov 992a2d556a FIR: Add ensureResolved calls for types of sub-expressions
These calls resolve a class that a type of expression is built upon
2020-09-01 17:43:30 +03:00
Denis Zharkov d05e947d25 FIR: Ensure resolved callable symbols came out of the declared scopes
Otherwise, we need to add `ensureResolved` to almost any usage of process*:
- Call resolution need fully resolved callables
- UseSiteScope when binding overrides should ensure resolved for callables from supertypes
- checkers have to make sure they use correct overridden
- SAM resolver
2020-09-01 17:43:30 +03:00
Denis Zharkov d80caf7dbf FIR: Extract common code in FirPackageMemberScope 2020-09-01 17:43:30 +03:00
Denis Zharkov b4aef21423 FIR: Simplify API for ensureResolved
Additional `as` casts look redundant, but it's a design issue (see KT-41421)
2020-09-01 17:43:30 +03:00
Denis Zharkov bb84dc2ed4 FIR: Minor. Extract common parts in FirClassDeclaredMemberScope 2020-09-01 17:43:30 +03:00
Denis Zharkov 1cc68762e1 FIR: Minor. Fix error message 2020-09-01 17:43:30 +03:00
Denis Zharkov 4cdc36abb3 FIR: Drop unused 'phasedFir' callables 2020-09-01 17:43:30 +03:00
Denis Zharkov c3c8115163 FIR: Use explicit version of 'ensureResolved' 2020-09-01 17:43:30 +03:00
Denis Zharkov 517056e0c6 FIR: Do not require specific phase for super-call receiver class
It's anyway defined in the outer context (outer class) that already
should have proper context
2020-09-01 17:43:30 +03:00
Denis Zharkov fcc2abcf40 FIR: Fix phase requirement for call resolution 2020-09-01 17:43:30 +03:00
Denis Zharkov ff182f191e FIR: Fix some contracts resolutions side-effects
- Resolve anonymous objects' contents
- Update phase for constructors
- Do not transform annotations
(while resolving they may refer to other declarations that don't have yet CONTRACTS phase)
2020-09-01 17:43:30 +03:00
Denis Zharkov 67cc85e02b FIR: Avoid redundant calls to ensureResolved during call resolution
Call ensureResolved only once when creating a candidate
2020-09-01 17:43:30 +03:00
Denis Zharkov bf2fc10cd6 FIR: Extract AbstractFirBasedSymbol::ensureResolved extension 2020-09-01 17:43:30 +03:00
Denis Zharkov 2529f541ba FIR: Prepare refactoring of phasedFir
- Rename PhasedFirFileResolver -> FirPhaseManager
- Move semantically significant parts to a component
2020-09-01 17:43:30 +03:00
Roman Golyshev 90c89bddc5 FIR IDE: Add collecting scopes for declarations
- They are required to perform completion in default arguments,
return types, and other declaration parts (except for body)
2020-09-01 10:09:46 +00:00
Dmitriy Novozhilov 6db8c28291 [FIR] Refactor session components initialization
From now all customization of session should perform via DSL which
  declared in FirSessionFactory. Registration or mutation session
  services from other places is prohibited
2020-09-01 12:00:12 +03:00
Dmitriy Novozhilov a8d23c36f5 [FIR] Introduce module :fir:entrypoint and FirSessionFactory for creating sessions 2020-09-01 12:00:12 +03:00
Dmitriy Novozhilov 94d58c714a [FIR] Cleanup dependencies for fir modules 2020-09-01 12:00:12 +03:00
Dmitriy Novozhilov 73e2314f2f [FIR] Get rid of dependency on intellijCore from :compiler:fir:resolve 2020-09-01 12:00:12 +03:00
Dmitriy Novozhilov 18ad56f7a8 [FIR] Fix creating fake source elements in declarations resolve 2020-09-01 12:00:12 +03:00
Dmitriy Novozhilov 28e6050551 [FIR] Extract java synthetic names calculation to platform specific component 2020-09-01 12:00:12 +03:00
Dmitriy Novozhilov 375140ebcc [FIR] Extract java class mapping to platform specific component 2020-09-01 12:00:11 +03:00