diff --git a/core/generic/generic.factor b/core/generic/generic.factor index d35ba01e52..2ef988139a 100755 --- a/core/generic/generic.factor +++ b/core/generic/generic.factor @@ -123,12 +123,13 @@ M: method-body definer M: method-body forget* dup "forgotten" word-prop [ drop ] [ [ - [ "method-class" word-prop ] - [ "method-generic" word-prop ] bi - dup generic? [ - [ delete-at* ] with-methods - [ call-next-method ] [ drop ] if - ] [ 2drop ] if + [ ] + [ "method-class" word-prop ] + [ "method-generic" word-prop ] tri + 3dup method eq? [ + [ delete-at ] with-methods + call-next-method + ] [ 3drop ] if ] [ t "forgotten" set-word-prop ] bi ] if ; diff --git a/core/parser/parser-tests.factor b/core/parser/parser-tests.factor index 9c3c1d9f6c..3df9dc9cb2 100755 --- a/core/parser/parser-tests.factor +++ b/core/parser/parser-tests.factor @@ -435,3 +435,28 @@ must-fail-with [ 92 ] [ "CHAR: \\" eval ] unit-test [ 92 ] [ "CHAR: \\\\" eval ] unit-test + +[ ] [ + { + "IN: parser.tests" + "USING: math arrays ;" + "GENERIC: change-combination" + "M: integer change-combination 1 ;" + "M: array change-combination 2 ;" + } "\n" join "change-combination-test" parse-stream drop +] unit-test + +[ ] [ + { + "IN: parser.tests" + "USING: math arrays ;" + "GENERIC# change-combination 1" + "M: integer change-combination 1 ;" + "M: array change-combination 2 ;" + } "\n" join "change-combination-test" parse-stream drop +] unit-test + +[ 2 ] [ + "change-combination" "parser.tests" lookup + "methods" word-prop assoc-size +] unit-test