From 806d79caba0247892d0ea1a8f49486d9e1d61755 Mon Sep 17 00:00:00 2001 From: Alexander Udalov Date: Thu, 18 Sep 2014 14:27:17 +0400 Subject: [PATCH] Minor, strip package name from class for script This is done to be able to construct a FqName of this class. Currently it's not possible because the name contains '/' and FqName validation fails. This name is only used for debugging and even the ClassDescriptor is used only as a key in binding context to store the internal name of the script class --- .../src/org/jetbrains/jet/codegen/binding/CodegenBinding.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/compiler/backend/src/org/jetbrains/jet/codegen/binding/CodegenBinding.java b/compiler/backend/src/org/jetbrains/jet/codegen/binding/CodegenBinding.java index f44a9de2dfd..54f8eeaf88f 100644 --- a/compiler/backend/src/org/jetbrains/jet/codegen/binding/CodegenBinding.java +++ b/compiler/backend/src/org/jetbrains/jet/codegen/binding/CodegenBinding.java @@ -142,8 +142,9 @@ public class CodegenBinding { @NotNull ScriptDescriptor scriptDescriptor, @NotNull Type asmType ) { + String simpleName = asmType.getInternalName().substring(asmType.getInternalName().lastIndexOf('/') + 1); ClassDescriptorImpl classDescriptor = - new ClassDescriptorImpl(scriptDescriptor, Name.special(""), Modality.FINAL, + new ClassDescriptorImpl(scriptDescriptor, Name.special(""), Modality.FINAL, Collections.singleton(KotlinBuiltIns.getInstance().getAnyType()), SourceElement.NO_SOURCE); classDescriptor.initialize(JetScope.EMPTY, Collections.emptySet(), null);