parser: allow void return type for C functions
parent
add4d391cb
commit
d7c63922d5
|
@ -136,7 +136,7 @@ pub fn (mut p Parser) parse_type() table.Type {
|
|||
if p.tok.kind != .lcbr {
|
||||
pos := p.tok.position()
|
||||
typ = p.parse_any_type(language, nr_muls > 0)
|
||||
if typ == table.void_type {
|
||||
if typ == table.void_type && is_optional {
|
||||
p.error_with_pos('use `?` instead of `?void`', pos)
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1 @@
|
|||
ok
|
|
@ -0,0 +1,4 @@
|
|||
fn C.some_c_function(int) void
|
||||
fn main() {
|
||||
println('ok')
|
||||
}
|
Loading…
Reference in New Issue