JET-68 Add default equals() to the library

This commit is contained in:
Andrey Breslav
2011-06-01 14:38:37 +04:00
parent 5413bebd33
commit ffba7af73a
3 changed files with 10 additions and 3 deletions
+2 -2
View File
@@ -7,8 +7,8 @@ namespace typeinfo {
}
}
fun Any?.equals(other : Any?) : Boolean = this === other
// Can't write a body due to a bootstrapping problem (see JET-74)
fun Any?.equals(other : Any?) : Boolean// = this === other
class Iterator<out T> {
fun next() : T
@@ -77,6 +77,12 @@ public class TopDownAnalyzer {
};
}
@Deprecated // For JetStandardLibraryOnly
public void processStandardLibraryNamespace(@NotNull WritableScope outerScope, @NotNull NamespaceDescriptorImpl standardLibraryNamespace, @NotNull JetNamespace namespace) {
namespaceScopes.put(namespace, standardLibraryNamespace.getMemberScope());
namespaceDescriptors.put(namespace, standardLibraryNamespace);
process(outerScope, standardLibraryNamespace, namespace.getDeclarations());
}
public void process(@NotNull WritableScope outerScope, NamespaceLike owner, @NotNull List<JetDeclaration> declarations) {
collectNamespacesAndClassifiers(outerScope, owner, declarations); // namespaceScopes, classes
@@ -75,7 +75,8 @@ public class JetStandardLibrary {
TopDownAnalyzer bootstrappingTDA = new TopDownAnalyzer(bootstrappingSemanticServices, bindingTraceContext);
WritableScopeImpl writableScope = new WritableScopeImpl(JetStandardClasses.STANDARD_CLASSES, JetStandardClasses.STANDARD_CLASSES_NAMESPACE, ErrorHandler.THROW_EXCEPTION);
// this.libraryScope = bootstrappingTDA.process(JetStandardClasses.STANDARD_CLASSES, file.getRootNamespace().getDeclarations());
bootstrappingTDA.process(writableScope, JetStandardClasses.STANDARD_CLASSES_NAMESPACE, file.getRootNamespace().getDeclarations());
// bootstrappingTDA.process(writableScope, JetStandardClasses.STANDARD_CLASSES_NAMESPACE, file.getRootNamespace().getDeclarations());
bootstrappingTDA.processStandardLibraryNamespace(writableScope, JetStandardClasses.STANDARD_CLASSES_NAMESPACE, file.getRootNamespace());
this.libraryScope = JetStandardClasses.STANDARD_CLASSES_NAMESPACE.getMemberScope();
AnalyzingUtils.applyHandler(ErrorHandler.THROW_EXCEPTION, bindingTraceContext);