defining a generic on something that is not a class would ruin the generic
parent
8b496e60ff
commit
6ff40d6cf3
|
@ -74,6 +74,9 @@ math-internals ;
|
|||
|
||||
: define-method ( class generic definition -- )
|
||||
-rot
|
||||
over metaclass word? [
|
||||
word-name " is not a class" append throw
|
||||
] unless
|
||||
[ "methods" word-prop set-hash ] keep dup <vtable>
|
||||
make-generic ;
|
||||
|
||||
|
|
|
@ -156,4 +156,4 @@ M: number union-containment drop 2 ;
|
|||
! Testing recovery from bad method definitions
|
||||
"GENERIC: unhappy" eval
|
||||
[ "M: vocabularies unhappy ;" eval ] unit-test-fails
|
||||
[ ] [ "GENERIC: unhapy" eval ] unit-test
|
||||
[ ] [ "GENERIC: unhappy" eval ] unit-test
|
||||
|
|
Loading…
Reference in New Issue