Metaclass.st
changeset 1698 0aaf983588b8
parent 1671 cceee8a44757
child 1724 ef3f680996db
--- a/Metaclass.st	Tue Oct 08 13:38:36 1996 +0200
+++ b/Metaclass.st	Tue Oct 08 16:49:06 1996 +0200
@@ -468,7 +468,7 @@
      classVarChange instVarChange superClassChange newComment
      changeSet1 changeSet2 addedNames
      anyChange oldInstVars newInstVars oldClassVars newClassVars superFlags newFlags
-     project currentProject t nClassInstVars|
+     project currentProject t nClassInstVars superInstVars|
 
     "NOTICE:
      this method is too complex and should be splitted into managable pieces ...
@@ -592,6 +592,19 @@
         ]
     ].
 
+    "
+     check for instVar redefs
+    "
+    aClass notNil ifTrue:[
+        superInstVars := aClass allInstVarNames.
+        stringOfInstVarNames asCollectionOfWords do:[:nm |
+            (superInstVars includes:nm) ifTrue:[
+                self error:'instVar ''' , nm , ''' is already defined in a superclass'.
+                ^ nil.
+            ]
+        ]
+    ].
+
     nClassInstVars := stringOfClassInstVarNames countWords.
 
     "create the metaclass first"
@@ -1100,7 +1113,7 @@
 
     "Created: 26.5.1996 / 11:55:26 / cg"
     "Modified: 18.6.1996 / 14:19:39 / stefan"
-    "Modified: 10.9.1996 / 20:02:59 / cg"
+    "Modified: 8.10.1996 / 15:46:04 / cg"
 !
 
 name:newName inEnvironment:aSystemDictionary
@@ -1449,5 +1462,5 @@
 !Metaclass  class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libbasic/Metaclass.st,v 1.63 1996-09-21 14:23:47 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/Metaclass.st,v 1.64 1996-10-08 14:49:06 cg Exp $'
 ! !