class: ImmutableString
authorStefan Vogel <sv@exept.de>
Thu, 20 Aug 2015 17:24:12 +0200
changeset 18704 e1dc90e637b9
parent 18703 a2887ae5eca8
child 18705 843770030c5f
child 18706 59b1a62da74e
class: ImmutableString added: #becomeSameAs:
ImmutableString.st
--- a/ImmutableString.st	Thu Aug 20 17:24:01 2015 +0200
+++ b/ImmutableString.st	Thu Aug 20 17:24:12 2015 +0200
@@ -208,6 +208,14 @@
     ^ super becomeNil
 
     "Created: / 3.8.1998 / 14:48:37 / cg"
+!
+
+becomeSameAs:anotherObject
+    "trigger an error if I should become something else
+     (this would be an even more tricky manipulation)"
+
+    self noModificationError.
+    ^ super becomeSameAs:anotherObject
 ! !
 
 !ImmutableString class methodsFor:'documentation'!