fix for KT-1515 wrong loading of annotations

This commit is contained in:
Alex Tkachman
2012-03-13 12:28:35 +02:00
parent 6b26d1ca31
commit c870eccc4f
8 changed files with 49 additions and 13 deletions
@@ -81,7 +81,8 @@ public abstract class AnnotationCodegen {
CompileTimeConstant<?> compileTimeConstant = bindingContext.get(BindingContext.COMPILE_TIME_VALUE, valueArguments.get(0));
assert compileTimeConstant != null;
annotationVisitor.visit(entry.getKey().getName(), compileTimeConstant.getValue());
Object value = compileTimeConstant.getValue();
annotationVisitor.visit(entry.getKey().getName(), value);
}
annotationVisitor.visitEnd();
@@ -72,8 +72,8 @@ public class IntrinsicMethods {
myProject = project;
myStdLib = stdlib;
namedMethods.put("\"kotlin.javaClass.function\"", new JavaClassFunction());
namedMethods.put("\"kotlin.javaClass.property\"", new JavaClassProperty());
namedMethods.put("kotlin.javaClass.function", new JavaClassFunction());
namedMethods.put("kotlin.javaClass.property", new JavaClassProperty());
List<String> primitiveCastMethods = OperatorConventions.NUMBER_CONVERSIONS.asList();
for (String method : primitiveCastMethods) {
@@ -246,7 +246,10 @@ public class IntrinsicMethods {
if (annotations != null) {
for (AnnotationDescriptor annotation : annotations) {
if("Intrinsic".equals(annotation.getType().getConstructor().getDeclarationDescriptor().getName())) {
intrinsicMethod = namedMethods.get(annotation.getValueArguments().get(0).getValue());
Object value = annotation.getValueArguments().get(0).getValue();
intrinsicMethod = namedMethods.get(value);
if(intrinsicMethod != null)
break;
}
}
}