mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
limitation.md: describe mruby limitation for keyword arguments; #5952
This commit is contained in:
@@ -259,3 +259,12 @@ f(1,[2,3])
|
||||
```
|
||||
|
||||
CRuby gives `[1,2,3,nil]`. mruby raises `NoMethodError` for `b`.
|
||||
|
||||
Keyword argument expansion has similar restrictions. The following example, gives `[1, 1]` for CRuby, mruby raises `NoMethodError` for `b`.
|
||||
|
||||
```ruby
|
||||
def g(a: 1, b: a)
|
||||
p [a,b]
|
||||
end
|
||||
g(a:1)
|
||||
```
|
||||
|
||||
Reference in New Issue
Block a user