Properly name packageFragments and packageFacade
This commit is contained in:
@@ -132,7 +132,7 @@ public final class ClassFileFactory extends GenerationStateAware {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@NotNull
|
@NotNull
|
||||||
public ClassBuilder forNamespacePart(@NotNull Type asmType, @NotNull PsiFile sourceFile) {
|
public ClassBuilder forPackageFragment(@NotNull Type asmType, @NotNull PsiFile sourceFile) {
|
||||||
return newVisitor(asmType, sourceFile);
|
return newVisitor(asmType, sourceFile);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -168,7 +168,7 @@ public class NamespaceCodegen extends MemberCodegen {
|
|||||||
@Nullable
|
@Nullable
|
||||||
private ClassBuilder generate(@NotNull JetFile file) {
|
private ClassBuilder generate(@NotNull JetFile file) {
|
||||||
boolean generateSrcClass = false;
|
boolean generateSrcClass = false;
|
||||||
FieldOwnerContext namespaceImpl = CodegenContext.STATIC.intoNamespace(descriptor);
|
FieldOwnerContext packageFragmentContext = CodegenContext.STATIC.intoNamespace(descriptor);
|
||||||
|
|
||||||
for (JetDeclaration declaration : file.getDeclarations()) {
|
for (JetDeclaration declaration : file.getDeclarations()) {
|
||||||
if (declaration instanceof JetProperty || declaration instanceof JetNamedFunction) {
|
if (declaration instanceof JetProperty || declaration instanceof JetNamedFunction) {
|
||||||
@@ -180,23 +180,22 @@ public class NamespaceCodegen extends MemberCodegen {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (declaration instanceof JetScript) {
|
else if (declaration instanceof JetScript) {
|
||||||
ScriptCodegen.createScriptCodegen((JetScript) declaration, state, namespaceImpl).generate();
|
ScriptCodegen.createScriptCodegen((JetScript) declaration, state, packageFragmentContext).generate();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!generateSrcClass) return null;
|
if (!generateSrcClass) return null;
|
||||||
|
|
||||||
Type namespacePartType = getNamespacePartType(getPackageClassFqName(name), file);
|
Type packageFragmentType = getNamespacePartType(getPackageClassFqName(name), file);
|
||||||
ClassBuilder builder = state.getFactory().forNamespacePart(namespacePartType, file);
|
ClassBuilder builder = state.getFactory().forPackageFragment(packageFragmentType, file);
|
||||||
|
|
||||||
NamespacePartCodegen namespacePartCodegen = new NamespacePartCodegen(builder, file, namespacePartType, namespaceImpl, state);
|
new NamespacePartCodegen(builder, file, packageFragmentType, packageFragmentContext, state).generate();
|
||||||
namespacePartCodegen.generate();
|
|
||||||
|
|
||||||
FieldOwnerContext nameSpacePart = CodegenContext.STATIC.intoNamespaceFacade(namespacePartType, descriptor);
|
FieldOwnerContext namespaceFacade = CodegenContext.STATIC.intoNamespaceFacade(packageFragmentType, descriptor);
|
||||||
|
|
||||||
for (JetDeclaration declaration : file.getDeclarations()) {
|
for (JetDeclaration declaration : file.getDeclarations()) {
|
||||||
if (declaration instanceof JetNamedFunction || declaration instanceof JetProperty) {
|
if (declaration instanceof JetNamedFunction || declaration instanceof JetProperty) {
|
||||||
genFunctionOrProperty(nameSpacePart, (JetTypeParameterListOwner) declaration, v.getClassBuilder());
|
genFunctionOrProperty(namespaceFacade, (JetTypeParameterListOwner) declaration, v.getClassBuilder());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user