Fix exception at accidentally wrong annotation argument type

#KT-13740 Fixed
This commit is contained in:
Mikhail Zarechenskiy
2017-02-06 19:14:18 +03:00
parent 655cf82534
commit 9f0403f72c
4 changed files with 30 additions and 1 deletions
@@ -1,5 +1,5 @@
/*
* Copyright 2010-2016 JetBrains s.r.o.
* Copyright 2010-2017 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -1518,6 +1518,10 @@ public class ExpressionCodegen extends KtVisitor<StackValue, StackValue> impleme
}
KotlinType expectedType = bindingContext.getType(expression);
if (expectedType == null) {
return null;
}
return compileTimeValue.toConstantValue(expectedType);
}