Here linearLayout() is a function that takes some other function, and that’s why the parens will be omitted:

linearLayout({
...
})
// same as:
linearLayout {
...
}

But after some quick thoughts I found how complex will it be to make Anvil compatible to this syntax. Basically it would be easier to rewrite it all from scratch rather than adjust it.

The worst part was attribute generators, like text(). In Anvil they return AttrNode instrances, while in Kotlin they should assign AttrNode instances to the parent ViewNode object.

Any ideas?

Minimally sweetened Anvil

Luckily, Kotlin has lots of syntax sugar. And it also has operator
overloading (oh, I know how bad it can be). We can keep the stack of nested
views and abuse some of the operators to assign AttrNode to the topmost
ViewNode.