Fix exception on trying to evaluate red code with inline classes

#KT-25600 Fixed
This commit is contained in:
Mikhail Zarechenskiy
2018-07-20 01:36:42 +03:00
parent 17243c08c1
commit f8d19718c8
4 changed files with 10 additions and 1 deletions
@@ -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)
@@ -0,0 +1 @@
val foo = <!INVISIBLE_MEMBER!>UInt<!>(<!NO_VALUE_FOR_PARAMETER!>)<!>
@@ -0,0 +1,3 @@
package
public val foo: kotlin.UInt
@@ -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");