Change object deserialization strategy

Objects now have synthetic class objects in deserialization as well. "Class"
proto message now can have a synthetic class object proto within, if it's not
contained in any external class file, which is the case with objects. Drop
"class_object_present" field from binary format, since its value is equivalent
to the presence of "class_object" field
This commit is contained in:
Alexander Udalov
2013-10-29 22:11:07 +04:00
parent 26bd1ff189
commit c04f63e157
17 changed files with 709 additions and 165 deletions
@@ -210,14 +210,12 @@ public class NamespaceCodegen extends MemberCodegen {
* @param namespaceFiles all files should have same package name
* @return
*/
public static boolean shouldGenerateNSClass(Collection<JetFile> namespaceFiles) {
public static boolean shouldGenerateNSClass(@NotNull Collection<JetFile> namespaceFiles) {
checkAllFilesHaveSameNamespace(namespaceFiles);
for (JetFile file : namespaceFiles) {
for (JetDeclaration declaration : file.getDeclarations()) {
if (declaration instanceof JetProperty ||
declaration instanceof JetNamedFunction ||
declaration instanceof JetObjectDeclaration) {
if (declaration instanceof JetProperty || declaration instanceof JetNamedFunction) {
return true;
}
}