def uni(**args)
puts "#{args.to_h}"
end
uni(a:123, b: "opa")
uni(a:123, b: "opa", c: Time.now)
Produce an error:
```in /usr/lib/crystal/named_tuple.cr:402: expanding macro
{% begin %}
^
in macro 'macro_206236176' /usr/lib/crystal/named_tuple.cr:402, line 8:
undefined method 'clone' for Time
```
version:
Crystal 0.21.1 (2017-03-14) LLVM 4.0.0
Duplicate of https://github.com/crystal-lang/crystal/pull/4174 (already fixed in master)
Actually, I'll reopen this. Why is there a clone
in NamedTuple#to_h
in the first place? :-S
@asterite heh, I was asking myself the same question but then I told to myself there must be a reason to that, and went ahead with #4174 ;)
Most helpful comment
Actually, I'll reopen this. Why is there a
clone
inNamedTuple#to_h
in the first place? :-S