Sealed classes have their `get_type` function declarations emitted to `*.c` files
When a class is defined as sealed
, the corresponding get_type
function declaration gets emitted to a .c
file instead of a .h
file.
public sealed class Foo.Bar : Object {}
$ valac --header foo.h --gir=Foo-0.gir --library foo --ccode foo.vala
$ rg '_type' foo.h
21:#define FOO_TYPE_BAR (foo_bar_get_type ())
29:VALA_EXTERN FooBar* foo_bar_construct (GType object_type);
$ rg 'VALA_EXTERN' foo.c
34:VALA_EXTERN GType foo_bar_get_type (void) G_GNUC_CONST
$ valac --version
Vala 0.56.7
Compare to this:
public class Foo.Bar : Object {}
$ valac --header foo.h --gir=Foo-0.gir --library foo --ccode foo.vala
$ rg '_type' foo.h
21:#define FOO_TYPE_BAR (foo_bar_get_type ())
41:VALA_EXTERN GType foo_bar_get_type (void) G_GNUC_CONST ;
44:VALA_EXTERN FooBar* foo_bar_construct (GType object_type);
$ rg 'VALA_EXTERN' foo.c
Edited by Tomoaki Kawada