]> gitweb.factorcode.org Git - factor.git/blob - basis/compiler/tests/redefine8.factor
874cb2633ecec08cfe9cdac0d903677b4eae5155
[factor.git] / basis / compiler / tests / redefine8.factor
1 USING: eval tools.test compiler.units vocabs words
2 kernel ;
3 IN: compiler.tests.redefine8
4
5 ! Mixin redefinition did not recompile all necessary words.
6
7 { } [ [ "compiler.tests.redefine8" forget-vocab ] with-compilation-unit ] unit-test
8
9 { } [
10     "USING: kernel math math.order sorting ;
11     IN: compiler.tests.redefine8
12     MIXIN: my-mixin
13     INSTANCE: fixnum my-mixin
14     GENERIC: my-generic ( a -- b )
15     ! We add the bogus quotation here to hinder inlining
16     ! since otherwise we cannot trigger this bug.
17     M: my-mixin my-generic 1 + [ [ <=> ] sort ] drop ;"
18     eval( -- )
19 ] unit-test
20
21 { } [
22     "USE: math
23     IN: compiler.tests.redefine8
24     INSTANCE: float my-mixin"
25     eval( -- )
26 ] unit-test
27
28 { 2.0 } [
29     1.0 "my-generic" "compiler.tests.redefine8" lookup-word execute
30 ] unit-test