Commit Graph

70930 Commits

Author SHA1 Message Date
Dmitriy Dolovov 8d9abed3dc [Commonizer] Minor. More specific upper bounds for CirNodeWithClassId 2020-11-26 10:56:59 +03:00
Mikhail Glukhikh d4b0bf4ad8 [FIR] Make DEFAULT positioning strategy public, drop duplicated one 2020-11-26 08:37:51 +03:00
Mikhail Glukhikh 97c1a3f270 Simplify FirSupertypeInitializedWithoutPrimaryConstructor checker 2020-11-26 08:37:51 +03:00
Mikhail Glukhikh bf2b318bee Simplify FirSupertypeInitializedInInterfaceChecker 2020-11-26 08:37:51 +03:00
Mikhail Glukhikh 12726cd366 FIR light builder: use type reference node as FirTypeRef source 2020-11-26 08:37:50 +03:00
Mikhail Glukhikh d5f17ea41c Simplify FirDelegationInInterfaceChecker 2020-11-26 08:37:50 +03:00
Mikhail Glukhikh b673996586 Simplify source operations in FirAnnotationArgumentChecker 2020-11-26 08:37:50 +03:00
Mikhail Glukhikh 1c71e64f58 [FIR] Create string interpolating call even for single argument
Before this commit, questionable optimization existed which
unwrapped string interpolating call with single argument to this argument.
However, this led to source element loss and the necessity of sub-hacks.
In this commit we dropped this optimization (anyway user can remove
this single-expression string template in code if needed) to keep
source elements intact.
2020-11-26 08:37:50 +03:00
Mikhail Glukhikh 915a66f4fa [FIR] Introduce & use "multiplexing" SourceElementPositioningStrategy 2020-11-26 08:37:50 +03:00
Mikhail Glukhikh f3334b03c4 FIR checkers: simplify FirSupertypeInitializedWithoutPrimaryConstructor 2020-11-26 08:37:50 +03:00
Mikhail Glukhikh 58301d8820 FIR exposed visibility checkers: use positioning strategy 2020-11-26 08:37:49 +03:00
Mikhail Glukhikh f095a33970 FIR checkers: extract getChildren(), simplify findSuperTypeDelegation() 2020-11-26 08:37:49 +03:00
Mikhail Glukhikh 1e3621a896 FIR checkers: simplify hasPrimaryConstructor by source element check 2020-11-26 08:37:49 +03:00
Mikhail Glukhikh 0838ab7fe7 FIR checkers: simplify hasVal / hasVar source element checks 2020-11-26 08:37:49 +03:00
Mikhail Glukhikh c6b703b598 Simplify LighterASTNode.toFirLightSourceElement 2020-11-26 08:37:49 +03:00
Mikhail Glukhikh 037c505069 Unbind general FirDiagnostic from PsiFile & PsiElement 2020-11-26 08:37:49 +03:00
Mikhail Glukhikh 68b748e164 Rename DebugInfoUtil.java to DebugInfoUtil.kt, same with AnalyzingUtils 2020-11-26 08:37:48 +03:00
Mikhail Glukhikh 6f8947dd04 Extract UnboundDiagnostic, DiagnosticFactory/Renderer to frontend-common 2020-11-26 08:37:48 +03:00
Mikhail Glukhikh 52a07e31c7 [FIR] Remove D_I_EXPRESSION_TYPE from qualified calls in spec test data
In FIR, the source of FirFunctionCall is set to call's selector.
In practice, sometimes (e.g. for DEBUG_INFO_CALL)
we expect the selector as the source,
and sometimes (e.g. for DEBUG_INFO_EXPRESSION_TYPE)
we expect the whole qualified call as the source.
Also, some diagnostics, like REDUNDANT_CALL_OF_CONVERSION_METHOD,
are expected to be reported on a selector, not on a whole call.
At this moment we ignore the problem & just don't support
DEBUG_INFO_EXPRESSION_TYPE for qualified calls.
2020-11-26 08:37:48 +03:00
Mikhail Glukhikh 558ac1678e Create FIR fake source element for checked safe call subject 2020-11-26 08:37:48 +03:00
Mikhail Glukhikh 2592eed0e7 [FIR TEST] More precise control of source kind in createDebugInfo 2020-11-26 08:37:48 +03:00
Mikhail Glukhikh 82c5cefba9 Update test data in FIR diagnostic spec tests 2020-11-26 08:37:48 +03:00
Mikhail Glukhikh e7e162c7eb [FIR TEST] Filter some particular tokens during createDebugInfo 2020-11-26 08:37:47 +03:00
Mikhail Glukhikh c602ccb33e Create FIR fake source element for vararg argument expression 2020-11-26 08:37:47 +03:00
Mikhail Glukhikh fa3f805573 Support FirDiagnostic.isValid properly
Diagnostic is considered valid in this commit if it's reported on
a syntactically non-erroneous element without erroneous last child
2020-11-26 08:37:47 +03:00
Mikhail Glukhikh c7ae176ae4 [FIR] Inherit FIR with parameter renderer from the old parameter renderer 2020-11-26 08:37:47 +03:00
Mikhail Glukhikh 3dec848c03 [FIR] Implement light tree DECLARATION_NAME & SIGNATURE strategies 2020-11-26 08:37:47 +03:00
Mikhail Glukhikh 42c59f7383 [FIR] Enhance light tree DEFAULT strategy for objects to cover header only 2020-11-26 08:37:46 +03:00
Mikhail Glukhikh d844b33b1c [FIR] Implement light tree CONSTRUCTOR_DELEGATION_CALL strategy
Default strategy sometimes delegates to the CONSTRUCTOR_DELEGATION_CALL
strategy, so we add it in this commit to process some related cases
properly.
2020-11-26 08:37:46 +03:00
Mikhail Glukhikh 8320a2966a [FIR] Implement light tree VAL_VAR strategy as an example 2020-11-26 08:37:46 +03:00
Mikhail Glukhikh 1795c4f3e5 Implement common Diagnostic(Factory/Renderer) in related FIR classes 2020-11-26 08:37:46 +03:00
Mikhail Glukhikh d47e16331c Convert DiagnosticFactory.java to Kotlin 2020-11-26 08:37:46 +03:00
Mikhail Glukhikh 84f3a4ba9d Rename DiagnosticFactory.java to DiagnosticFactory.kt 2020-11-26 08:37:46 +03:00
Mikhail Glukhikh 9040999b55 Convert Diagnostic.java to Kotlin 2020-11-26 08:37:45 +03:00
Mikhail Glukhikh b6cfcc6cad Rename Diagnostic.java to Diagnostic.kt 2020-11-26 08:37:45 +03:00
Mikhail Glukhikh d942780c14 [FIR] Introduce LightTreePositioningStrategy 2020-11-26 08:37:45 +03:00
Mikhail Glukhikh 1cb2aeaeff FirSourceElement: introduce common 'treeStructure' property 2020-11-26 08:37:45 +03:00
Mikhail Glukhikh 3a2b15521b FirSourceElement: introduce common 'lighterASTNode' property 2020-11-26 08:37:45 +03:00
Zalim Bashorov 6abd656116 [IR] dumpKotlinLike: update testdata after rebase 2020-11-26 00:15:26 +03:00
Zalim Bashorov 0d5a0b207e [IR] KotlinLikeDumper: add a note about some conventions used for TODO comments 2020-11-26 00:15:25 +03:00
Zalim Bashorov c004269547 [IR] KotlinLikeDumper: unify and add more comments for the cases when used a syntax which is invalid in Kotlin 2020-11-26 00:15:24 +03:00
Zalim Bashorov 5a755054f8 [IR] dumpKotlinLike: add a comment about some conventions which could be unclear 2020-11-26 00:15:22 +03:00
Zalim Bashorov 69f0f4ef19 [IR] update testdata: unify printing custom/non-standard modifiers 2020-11-26 00:15:21 +03:00
Zalim Bashorov 90fdfbde68 [IR] KotlinLikeDumper: unify printing custom/non-standard modifiers 2020-11-26 00:15:19 +03:00
Zalim Bashorov 57cb8f97e9 [IR] update testdata: don't use "D" suffix on double constants 2020-11-26 00:15:18 +03:00
Zalim Bashorov 73771a3513 [IR] KotlinLikeDumper: don't use "D" suffix on double constants 2020-11-26 00:15:17 +03:00
Zalim Bashorov 7df6575a18 [IR] update testdata: unify representation for error nodes 2020-11-26 00:15:16 +03:00
Zalim Bashorov ef9a901635 [IR] KotlinLikeDumper: unify representation for error nodes 2020-11-26 00:15:15 +03:00
Zalim Bashorov f8690d0395 [IR] KotlinLikeDumper: minor, collapse an if to helper function and add few more todos 2020-11-26 00:15:14 +03:00
Zalim Bashorov c68040753d [IR] dumpKotlinLike: add testdata for FIR tests 2020-11-26 00:15:13 +03:00