We should either document this / make it a clearer error, or we could change it to be allowed. Allowing it would make some things more tricky perhaps.
$ mirah -e 'package = 1234;puts package'
DashE:1:
ERROR: expected dotted_name before ' = 1234;puts '
package = 1234;puts package
^
DashE parsed to nil
1 errors