[AA] getExpectedType should not calculate expression type
if property doesn't specify explicit type, property's return type would be calculated by provided initializer ^KT-62588 fixed Merge-request: KT-MR-12564 Merged-by: Anna Kozlova <Anna.Kozlova@jetbrains.com>
This commit is contained in:
+2
@@ -191,6 +191,8 @@ class KtFe10ExpressionTypeProvider(
|
||||
return null
|
||||
}
|
||||
|
||||
if (parentExpression.typeReference == null) return null
|
||||
|
||||
val bindingContext = analysisContext.analyze(parentExpression)
|
||||
val descriptor = bindingContext[BindingContext.DECLARATION_TO_DESCRIPTOR, parentExpression]
|
||||
if (descriptor is CallableDescriptor) {
|
||||
|
||||
+6
@@ -280,6 +280,12 @@ public class Fe10IdeNormalAnalysisSourceModuleExpectedExpressionTypeTestGenerate
|
||||
runTest("analysis/analysis-api/testData/components/expressionTypeProvider/expectedExpressionType/propertyDeclaration.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("propertyDeclarationNoExplicitType.kt")
|
||||
public void testPropertyDeclarationNoExplicitType() throws Exception {
|
||||
runTest("analysis/analysis-api/testData/components/expressionTypeProvider/expectedExpressionType/propertyDeclarationNoExplicitType.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("propertyDeclarationQualified.kt")
|
||||
public void testPropertyDeclarationQualified() throws Exception {
|
||||
|
||||
Reference in New Issue
Block a user