From de1e8299b405c6567e21d121b29a2bb11dfe9701 Mon Sep 17 00:00:00 2001 From: Patrick R Date: Wed, 23 Aug 2023 14:41:44 +0200 Subject: [PATCH] Fixes an issue in ContextS2 resulting from using class identity instead of name when determining whether two partial methods are the same. As a result the partial method is not correctly removed in case of a recompile within a new class. (cherry-picked from commit b46aace3b6f491f4b234a83de38593ab145a3deb) --- .../CSPartialMethod.extension/instance/^equals.st | 8 ++++++++ .../CSPartialMethod.extension/instance/hash.st | 5 +++++ .../CSPartialMethod.extension/methodProperties.json | 6 ++++++ .../CSPartialMethod.extension/properties.json | 2 ++ 4 files changed, 21 insertions(+) create mode 100644 packages/Babylonian-Compiler.package/CSPartialMethod.extension/instance/^equals.st create mode 100644 packages/Babylonian-Compiler.package/CSPartialMethod.extension/instance/hash.st create mode 100644 packages/Babylonian-Compiler.package/CSPartialMethod.extension/methodProperties.json create mode 100644 packages/Babylonian-Compiler.package/CSPartialMethod.extension/properties.json diff --git a/packages/Babylonian-Compiler.package/CSPartialMethod.extension/instance/^equals.st b/packages/Babylonian-Compiler.package/CSPartialMethod.extension/instance/^equals.st new file mode 100644 index 00000000..15b956dd --- /dev/null +++ b/packages/Babylonian-Compiler.package/CSPartialMethod.extension/instance/^equals.st @@ -0,0 +1,8 @@ +*Babylonian-Compiler += anotherPartialMethod + "see #hash" + + ^ anotherPartialMethod class == self class + and: [self basicLayers = anotherPartialMethod basicLayers + and: [self selector = anotherPartialMethod selector + and: [self methodClass name = anotherPartialMethod methodClass name]]] \ No newline at end of file diff --git a/packages/Babylonian-Compiler.package/CSPartialMethod.extension/instance/hash.st b/packages/Babylonian-Compiler.package/CSPartialMethod.extension/instance/hash.st new file mode 100644 index 00000000..9341fe90 --- /dev/null +++ b/packages/Babylonian-Compiler.package/CSPartialMethod.extension/instance/hash.st @@ -0,0 +1,5 @@ +*Babylonian-Compiler +hash + "see #=" + + ^ (self basicLayers hash bitXor: self selector hash) bitXor: self class name hash \ No newline at end of file diff --git a/packages/Babylonian-Compiler.package/CSPartialMethod.extension/methodProperties.json b/packages/Babylonian-Compiler.package/CSPartialMethod.extension/methodProperties.json new file mode 100644 index 00000000..5f9fff49 --- /dev/null +++ b/packages/Babylonian-Compiler.package/CSPartialMethod.extension/methodProperties.json @@ -0,0 +1,6 @@ +{ + "class" : { + }, + "instance" : { + "=" : "sp 8/23/2023 14:35", + "hash" : "sp 8/23/2023 14:36" } } diff --git a/packages/Babylonian-Compiler.package/CSPartialMethod.extension/properties.json b/packages/Babylonian-Compiler.package/CSPartialMethod.extension/properties.json new file mode 100644 index 00000000..70e6d6e7 --- /dev/null +++ b/packages/Babylonian-Compiler.package/CSPartialMethod.extension/properties.json @@ -0,0 +1,2 @@ +{ + "name" : "CSPartialMethod" }