]> gitweb.factorcode.org Git - factor.git/commitdiff
alien.c-types: fix bad use of ?when
authorDoug Coleman <doug.coleman@gmail.com>
Sat, 25 Feb 2023 19:39:41 +0000 (13:39 -0600)
committerDoug Coleman <doug.coleman@gmail.com>
Sun, 26 Feb 2023 23:11:05 +0000 (17:11 -0600)
basis/alien/c-types/c-types-tests.factor
basis/alien/c-types/c-types.factor

index b13faf45c72cf4f819a4464e35ec42ffd6c0370d..7c846d0d14f1278b4423a22bd25569030fa87b23 100644 (file)
@@ -165,3 +165,5 @@ USE: alien.syntax
 USE: alien.c-types
 TYPEDEF: void* foo-func
 " eval( -- )
+
+[ void resolve-typedef ] [ T{ no-c-type f void } = ] must-fail-with
index 8d645132b2f0d57f687a335b60faa78215645b9a..fa6b8a9351e24dcbc038771131715bc32ce49a36 100644 (file)
@@ -54,7 +54,7 @@ UNION: c-type-name
     c-type-word pointer ;
 
 : resolve-typedef ( name -- c-type )
-    [ void? ] [ no-c-type ] ?when
+    dup void? [ no-c-type ] when
     dup c-type-name? [ lookup-c-type ] when ;
 
 M: word lookup-c-type