KT-864 wrong namespace class name generation
This commit is contained in:
@@ -4,6 +4,7 @@ import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
import org.jetbrains.jet.lang.descriptors.*;
|
||||
import org.jetbrains.jet.lang.descriptors.annotations.AnnotationDescriptor;
|
||||
import org.jetbrains.jet.lang.resolve.DescriptorUtils;
|
||||
import org.jetbrains.jet.lang.types.JetType;
|
||||
import org.objectweb.asm.Type;
|
||||
import org.objectweb.asm.commons.InstructionAdapter;
|
||||
@@ -86,10 +87,11 @@ public abstract class CodegenContext {
|
||||
}
|
||||
|
||||
public String getNamespaceClassName() {
|
||||
if(parentContext != STATIC)
|
||||
return parentContext.getNamespaceClassName();
|
||||
|
||||
return NamespaceCodegen.getJVMClassName(contextType.getName());
|
||||
DeclarationDescriptor descriptor = contextType;
|
||||
while(!(descriptor instanceof NamespaceDescriptor)) {
|
||||
descriptor = descriptor.getContainingDeclaration();
|
||||
}
|
||||
return NamespaceCodegen.getJVMClassName(DescriptorUtils.getFQName(descriptor));
|
||||
}
|
||||
|
||||
public OwnerKind getContextKind() {
|
||||
|
||||
@@ -173,10 +173,10 @@ public class GenerationState {
|
||||
final ClassFileFactory factory = getFactory();
|
||||
List<String> files = factory.files();
|
||||
for (String file : files) {
|
||||
if (!file.startsWith("std/")) {
|
||||
// if (!file.startsWith("std/")) {
|
||||
answer.append("@").append(file).append('\n');
|
||||
answer.append(factory.asText(file));
|
||||
}
|
||||
// }
|
||||
}
|
||||
|
||||
return answer.toString();
|
||||
|
||||
@@ -119,7 +119,7 @@ public class NamespaceCodegen {
|
||||
|
||||
private void generateTypeInfoFields(JetFile file, CodegenContext context) {
|
||||
if(context.typeInfoConstants != null) {
|
||||
String jvmClassName = getJVMClassName(file.getNamespaceHeader().getName());
|
||||
String jvmClassName = getJVMClassName(JetPsiUtil.getFQName(file));
|
||||
for(int index = 0; index != context.typeInfoConstantsCount; index++) {
|
||||
JetType type = context.reverseTypeInfoConstants.get(index);
|
||||
String fieldName = "$typeInfoCache$" + index;
|
||||
|
||||
Reference in New Issue
Block a user