Missing @NotNull and assertions added
This commit is contained in:
@@ -111,6 +111,7 @@ public class NamespaceCodegen extends MemberCodegen {
|
|||||||
|
|
||||||
private void generate(JetFile file, boolean multiFile) {
|
private void generate(JetFile file, boolean multiFile) {
|
||||||
NamespaceDescriptor descriptor = state.getBindingContext().get(BindingContext.FILE_TO_NAMESPACE, file);
|
NamespaceDescriptor descriptor = state.getBindingContext().get(BindingContext.FILE_TO_NAMESPACE, file);
|
||||||
|
assert descriptor != null : "No namespace found for file " + file + " declared package: " + file.getPackageName();
|
||||||
for (JetDeclaration declaration : file.getDeclarations()) {
|
for (JetDeclaration declaration : file.getDeclarations()) {
|
||||||
if (declaration instanceof JetProperty) {
|
if (declaration instanceof JetProperty) {
|
||||||
final CodegenContext context = CodegenContext.STATIC.intoNamespace(descriptor);
|
final CodegenContext context = CodegenContext.STATIC.intoNamespace(descriptor);
|
||||||
|
|||||||
@@ -135,7 +135,7 @@ public abstract class CodegenContext {
|
|||||||
return contextKind;
|
return contextKind;
|
||||||
}
|
}
|
||||||
|
|
||||||
public CodegenContext intoNamespace(NamespaceDescriptor descriptor) {
|
public CodegenContext intoNamespace(@NotNull NamespaceDescriptor descriptor) {
|
||||||
return new NamespaceContext(descriptor, this, OwnerKind.NAMESPACE);
|
return new NamespaceContext(descriptor, this, OwnerKind.NAMESPACE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ import org.jetbrains.jet.codegen.OwnerKind;
|
|||||||
import org.jetbrains.jet.lang.descriptors.NamespaceDescriptor;
|
import org.jetbrains.jet.lang.descriptors.NamespaceDescriptor;
|
||||||
|
|
||||||
public class NamespaceContext extends CodegenContext {
|
public class NamespaceContext extends CodegenContext {
|
||||||
public NamespaceContext(NamespaceDescriptor contextDescriptor, CodegenContext parent, @NotNull OwnerKind kind) {
|
public NamespaceContext(@NotNull NamespaceDescriptor contextDescriptor, CodegenContext parent, @NotNull OwnerKind kind) {
|
||||||
super(contextDescriptor, kind, parent, null, null, null);
|
super(contextDescriptor, kind, parent, null, null, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user