Issue #15956 has been reported by Tietew (Toru Iwase).

----------------------------------------
Bug #15956: `{*nil}` causes confusing error message
https://bugs.ruby-lang.org/issues/15956

* Author: Tietew (Toru Iwase)
* Status: Open
* Priority: Normal
* Assignee: 
* Target version: 
* ruby -v: ruby 2.7.0dev (2019-06-24T15:19:49Z trunk e09afd15b7) [x86_64-linux]
* Backport: 2.4: UNKNOWN, 2.5: UNKNOWN, 2.6: UNKNOWN
----------------------------------------
```
$ ruby -e 'p({*nil})'
-e:1: syntax error, unexpected *, expecting '}'
p({*nil})
-e:1: Can't assign to nil
p({*nil})
```

First syntax error is intended.
But second error message `Can't assign to nil` is confusing.

This happens with `nil`, `true`, `false` and `self`.
Other identifiers including keywords don't.



-- 
https://bugs.ruby-lang.org/

Unsubscribe: <mailto:ruby-core-request / ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>