Commit c58e578c authored by Tobias Pape's avatar Tobias Pape Committed by Stefan Marr

add some type assertions

parent 920240b8
......@@ -382,6 +382,7 @@ class Universe(object):
def new_integer(self, value):
assert isinstance(value, int)
# Allocate a new integer and set its class to be the integer class
result = Integer(self.nilObject)
......@@ -10,6 +10,7 @@ class Integer(Object):
return self._embedded_integer
def set_embedded_integer(self, value):
assert isinstance(value, int)
self._embedded_integer = value
def get_embedded_value(self):
......@@ -39,10 +39,13 @@ class Object(object):
def get_field(self, index):
# Get the field with the given index
assert isinstance(index, int)
return self._fields[index]
def set_field(self, index, value):
# Set the field with the given index to the given value
assert isinstance(index, int)
assert isinstance(value, Object)
self._fields[index] = value
def send(self, selector_string, arguments, universe, interpreter):
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment