"type empty cannot be part of a union" Error

typedef default-match {
type empty;
}

leaf entry-match {
type union {
type int32;
type default-match;
}
}

Is this leaf definition allowed ? I am observing the error “type empty cannot be part of a union”.

Not possible per the RFC:

9.12. The union Built-In Type

The union built-in type represents a value that corresponds to one of
its member types.

When the type is “union”, the “type” statement (Section 7.4) MUST be
present. It is used to repeatedly specify each member type of the
union. It takes as an argument a string that is the name of a member
type.

A member type can be of any built-in or derived type, except it MUST
NOT be one of the built-in types “empty” or “leafref”.

When a string representing a union data type is validated, the string
is validated against each member type, in the order they are
specified in the “type” statement, until a match is found.

Any default value or “units” property defined in the member types is
not inherited by the union type.