Fix exception on trying to evaluate red code with inline classes
#KT-25600 Fixed
This commit is contained in:
+1
-1
@@ -810,7 +810,7 @@ private class ConstantExpressionEvaluatorVisitor(
|
||||
|
||||
val underlyingType = classDescriptor.underlyingRepresentation()?.type ?: return null
|
||||
|
||||
val argument = valueArguments.values.single().arguments.single()
|
||||
val argument = valueArguments.values.singleOrNull()?.arguments?.singleOrNull() ?: return null
|
||||
val argumentExpression = argument.getArgumentExpression() ?: return null
|
||||
|
||||
val compileTimeConstant = evaluate(argumentExpression, underlyingType)
|
||||
|
||||
Vendored
+1
@@ -0,0 +1 @@
|
||||
val foo = <!INVISIBLE_MEMBER!>UInt<!>(<!NO_VALUE_FOR_PARAMETER!>)<!>
|
||||
Vendored
+3
@@ -0,0 +1,3 @@
|
||||
package
|
||||
|
||||
public val foo: kotlin.UInt
|
||||
+5
@@ -34,6 +34,11 @@ public class DiagnosticsWithUnsignedTypesGenerated extends AbstractDiagnosticsWi
|
||||
runTest("compiler/testData/diagnostics/testsWithUnsignedTypes/allowedVarargsOfUnsignedTypes.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("callDefaultConstructorOfUnsignedType.kt")
|
||||
public void testCallDefaultConstructorOfUnsignedType() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/testsWithUnsignedTypes/callDefaultConstructorOfUnsignedType.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("explicitUnsignedLongTypeCheck.kt")
|
||||
public void testExplicitUnsignedLongTypeCheck() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/testsWithUnsignedTypes/explicitUnsignedLongTypeCheck.kt");
|
||||
|
||||
Reference in New Issue
Block a user