Groups keyboard shortcuts have been updated
Dismiss
See shortcuts

PSA: You no longer need to write (struct {}) in FIDL

8 views
Skip to first unread message

Mitchell Kember

unread,
Oct 25, 2022, 1:28:40 AM10/25/22
to fidl-dev, anno...@fuchsia.dev
You can stop reading if you don't write FIDL code.

The FIDL syntax for empty responses has been simplified.

Before, empty responses had to be written (struct {}) if the method had an error:

protocol Foo {
    Bar() -> (struct {}) error uint32;
}

Now, you can simply write empty parentheses:

protocol Foo {
    Bar() -> () error uint32;
}

Both are allowed right now, but soon only the new way will be allowed. I will migrate all existing code.

See fxbug.dev/112767 for details.
Reply all
Reply to author
Forward
0 new messages