A shelf literal can only appear inside of a scope.

#2178   Compile-time error

A shelf literal can only appear inside of a scope.

Explanation

A shelf literal appears inside a rule guard or an initializer of a global or a field shelf. This is not allowed.