compiler tests: fix using, add tests to make sure instance? inlines

db4
Doug Coleman 2011-11-23 01:01:11 -08:00
parent b37bebb17f
commit f7700809c5
2 changed files with 20 additions and 1 deletions

View File

@ -1,5 +1,5 @@
USING: accessors classes.tuple classes.maybe compiler.units
kernel math slots tools.test ;
kernel math slots tools.test classes.union ;
IN: compiler.tests.redefine26
TUPLE: yoo ;

View File

@ -1006,3 +1006,22 @@ M: tuple-with-read-only-slot clone
[ V{ t } ] [
[ tag 0 15 between? ] final-literals
] unit-test
[ t ] [
[ maybe: integer instance? ] { instance? } inlined?
] unit-test
TUPLE: inline-please a ;
[ t ] [
[ maybe: inline-please instance? ] { instance? } inlined?
] unit-test
GENERIC: derp ( obj -- obj' )
M: integer derp 5 + ;
M: f derp drop t ;
[ t ]
[
[ dup maybe: integer instance? [ derp ] when ] { instance? } inlined?
] unit-test