[AA FIR] fix exception from vararg parameter with invalid type
It is true that for vararg parameter `arrayElementType` always have to be not null, but it required resolution to TYPES phase. But in case of the error type, the type reference is treated as resolved, so we are not obligatory to resolve such reference to TYPES, because we already have the resolved type. So we can make the rule of KtFirValueParameterSymbol#returnType less strict, and varargElementType will effectively do the same as lazy resolve + arrayElementType ^KT-61422 Fixed
This commit is contained in:
@@ -0,0 +1,4 @@
|
||||
// DO_NOT_CHECK_NON_PSI_SYMBOL_RESTORE_K1
|
||||
fun foo(vararg ints: Int) {
|
||||
|
||||
}
|
||||
+1
@@ -0,0 +1 @@
|
||||
fun foo(vararg ints: kotlin.Int)
|
||||
+54
@@ -0,0 +1,54 @@
|
||||
KtFunctionSymbol:
|
||||
annotationsList: []
|
||||
callableIdIfNonLocal: /foo
|
||||
contextReceivers: []
|
||||
contractEffects: []
|
||||
hasStableParameterNames: true
|
||||
isActual: false
|
||||
isBuiltinFunctionInvoke: false
|
||||
isExpect: false
|
||||
isExtension: false
|
||||
isExternal: false
|
||||
isInfix: false
|
||||
isInline: false
|
||||
isOperator: false
|
||||
isOverride: false
|
||||
isStatic: false
|
||||
isSuspend: false
|
||||
modality: FINAL
|
||||
name: foo
|
||||
origin: SOURCE
|
||||
receiverParameter: null
|
||||
returnType: KtUsualClassType:
|
||||
annotationsList: []
|
||||
ownTypeArguments: []
|
||||
type: kotlin/Unit
|
||||
symbolKind: TOP_LEVEL
|
||||
typeParameters: []
|
||||
valueParameters: [
|
||||
KtValueParameterSymbol:
|
||||
annotationsList: []
|
||||
callableIdIfNonLocal: null
|
||||
contextReceivers: []
|
||||
generatedPrimaryConstructorProperty: null
|
||||
hasDefaultValue: false
|
||||
isCrossinline: false
|
||||
isExtension: false
|
||||
isImplicitLambdaParameter: false
|
||||
isNoinline: false
|
||||
isVararg: true
|
||||
name: ints
|
||||
origin: SOURCE
|
||||
receiverParameter: null
|
||||
returnType: KtUsualClassType:
|
||||
annotationsList: []
|
||||
ownTypeArguments: []
|
||||
type: kotlin/Int
|
||||
symbolKind: LOCAL
|
||||
typeParameters: []
|
||||
getContainingModule: KtSourceModule "Sources of main"
|
||||
deprecationStatus: null
|
||||
]
|
||||
visibility: Public
|
||||
getContainingModule: KtSourceModule "Sources of main"
|
||||
deprecationStatus: null
|
||||
+1
@@ -0,0 +1 @@
|
||||
fun foo(vararg ints: ERROR(No type specified for unknown element))
|
||||
analysis/analysis-api/testData/symbols/symbolByPsi/valueParameters/varargWithoutType.descriptors.txt
Vendored
+53
@@ -0,0 +1,53 @@
|
||||
KtFunctionSymbol:
|
||||
annotationsList: []
|
||||
callableIdIfNonLocal: /foo
|
||||
contextReceivers: []
|
||||
contractEffects: []
|
||||
hasStableParameterNames: true
|
||||
isActual: false
|
||||
isBuiltinFunctionInvoke: false
|
||||
isExpect: false
|
||||
isExtension: false
|
||||
isExternal: false
|
||||
isInfix: false
|
||||
isInline: false
|
||||
isOperator: false
|
||||
isOverride: false
|
||||
isStatic: false
|
||||
isSuspend: false
|
||||
modality: FINAL
|
||||
name: foo
|
||||
origin: SOURCE
|
||||
receiverParameter: null
|
||||
returnType: KtUsualClassType:
|
||||
annotationsList: []
|
||||
ownTypeArguments: []
|
||||
type: kotlin/Unit
|
||||
symbolKind: TOP_LEVEL
|
||||
typeParameters: []
|
||||
valueParameters: [
|
||||
KtValueParameterSymbol:
|
||||
annotationsList: []
|
||||
callableIdIfNonLocal: null
|
||||
contextReceivers: []
|
||||
generatedPrimaryConstructorProperty: null
|
||||
hasDefaultValue: false
|
||||
isCrossinline: false
|
||||
isExtension: false
|
||||
isImplicitLambdaParameter: false
|
||||
isNoinline: false
|
||||
isVararg: true
|
||||
name: ints
|
||||
origin: SOURCE
|
||||
receiverParameter: null
|
||||
returnType: KtTypeErrorType:
|
||||
annotationsList: []
|
||||
type: ERROR_TYPE
|
||||
symbolKind: LOCAL
|
||||
typeParameters: []
|
||||
getContainingModule: KtSourceModule "Sources of main"
|
||||
deprecationStatus: null
|
||||
]
|
||||
visibility: Public
|
||||
getContainingModule: KtSourceModule "Sources of main"
|
||||
deprecationStatus: null
|
||||
+4
@@ -0,0 +1,4 @@
|
||||
// DO_NOT_CHECK_NON_PSI_SYMBOL_RESTORE_K1
|
||||
fun foo(vararg ints:) {
|
||||
|
||||
}
|
||||
Vendored
+1
@@ -0,0 +1 @@
|
||||
fun foo(vararg ints: ERROR(Incomplete code))
|
||||
+53
@@ -0,0 +1,53 @@
|
||||
KtFunctionSymbol:
|
||||
annotationsList: []
|
||||
callableIdIfNonLocal: /foo
|
||||
contextReceivers: []
|
||||
contractEffects: []
|
||||
hasStableParameterNames: true
|
||||
isActual: false
|
||||
isBuiltinFunctionInvoke: false
|
||||
isExpect: false
|
||||
isExtension: false
|
||||
isExternal: false
|
||||
isInfix: false
|
||||
isInline: false
|
||||
isOperator: false
|
||||
isOverride: false
|
||||
isStatic: false
|
||||
isSuspend: false
|
||||
modality: FINAL
|
||||
name: foo
|
||||
origin: SOURCE
|
||||
receiverParameter: null
|
||||
returnType: KtUsualClassType:
|
||||
annotationsList: []
|
||||
ownTypeArguments: []
|
||||
type: kotlin/Unit
|
||||
symbolKind: TOP_LEVEL
|
||||
typeParameters: []
|
||||
valueParameters: [
|
||||
KtValueParameterSymbol:
|
||||
annotationsList: []
|
||||
callableIdIfNonLocal: null
|
||||
contextReceivers: []
|
||||
generatedPrimaryConstructorProperty: null
|
||||
hasDefaultValue: false
|
||||
isCrossinline: false
|
||||
isExtension: false
|
||||
isImplicitLambdaParameter: false
|
||||
isNoinline: false
|
||||
isVararg: true
|
||||
name: ints
|
||||
origin: SOURCE
|
||||
receiverParameter: null
|
||||
returnType: KtTypeErrorType:
|
||||
annotationsList: []
|
||||
type: ERROR CLASS: Incomplete code
|
||||
symbolKind: LOCAL
|
||||
typeParameters: []
|
||||
getContainingModule: KtSourceModule "Sources of main"
|
||||
deprecationStatus: null
|
||||
]
|
||||
visibility: Public
|
||||
getContainingModule: KtSourceModule "Sources of main"
|
||||
deprecationStatus: null
|
||||
Reference in New Issue
Block a user