Better error message

db4
Slava Pestov 2008-04-26 18:55:26 -05:00
parent 14b78f348e
commit 6ee115901a
2 changed files with 12 additions and 3 deletions

View File

@ -345,6 +345,11 @@ M: invalid-slot-name summary
[ >r tuple parse-tuple-slots r> prefix ]
} case 3dup check-slot-shadowing ;
ERROR: not-in-a-method-error ;
M: not-in-a-method-error summary
drop "call-next-method can only be called in a method definition" ;
ERROR: staging-violation word ;
M: staging-violation summary

View File

@ -189,8 +189,12 @@ IN: bootstrap.syntax
] define-syntax
"call-next-method" [
current-class get literalize parsed
current-generic get literalize parsed
\ (call-next-method) parsed
current-class get current-generic get
2dup [ word? ] both? [
[ literalize parsed ] bi@
\ (call-next-method) parsed
] [
not-in-a-method-error
] if
] define-syntax
] with-compilation-unit