Fix meta_class, sis lass instance variables and class methods

after some serious recursive thinking it now actually makes sense
The key was to change the actual type of the class that the meta_class manages
For objects it's (still) ok just to change the instance_type, but since the class object exists and has type, when adding instance variables, that actual type has to change
This commit is contained in:
2019-09-23 20:42:46 +03:00
parent 7b40bb9106
commit 6993e337bf
8 changed files with 60 additions and 34 deletions

View File

@ -43,6 +43,12 @@ module Parfait
inspect
end
# adding an instance changes the instance_type to include that variable
def add_instance_variable( name , type)
super(name,type)
@clazz.set_type(@instance_type)
end
# Nil name means no superclass, and so nil returned
def super_class
return nil