FuncOp parsing bug?

Looks like the following:

func @foo() {

is accepted today by the FuncOp parser, but since the region is empty, the parsed function is considered a declaration. That seems deceptive. Should we fail the to parse this (i.e., fail parsing if the parsed region is specified but empty)?


I agree! I actually had this argument with River but we couldn’t agree on the right way to resolve this…

Yep, definitely a bug and should be rejected. The funcop parser should check to see if the region is empty when present and emit an error.