forked from alex-eg/sex
add malformed fn form match case in fmt-c-writer
Spent like 10 minutes trying to understand why my fn pointer is being fucked up in test case. Turned out I was missing return type, and whole fn pointer type fall through down to defaut case.
This commit is contained in:
@@ -126,6 +126,8 @@
|
|||||||
`(%array ,(walk-type (maybe-unwrap-type array-type)))))
|
`(%array ,(walk-type (maybe-unwrap-type array-type)))))
|
||||||
(('fn arglist ret-type)
|
(('fn arglist ret-type)
|
||||||
`(%fun ,(walk-type ret-type) ,(walk-arglist arglist)))
|
`(%fun ,(walk-type ret-type) ,(walk-arglist arglist)))
|
||||||
|
(('fn . _)
|
||||||
|
(assert #f "Malformed function type form"))
|
||||||
|
|
||||||
;; Special case: nested structs/unions
|
;; Special case: nested structs/unions
|
||||||
((or ('struct . _)
|
((or ('struct . _)
|
||||||
|
|||||||
Reference in New Issue
Block a user