You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As an argument to regular defs, the resulting Proc takes no arguments:
moduleLdefself.foo(x : ->)
enddefself.foo(x : Int32->)
endenddefbar(x =0)
endL.foo(->bar) # expands to `-> { bar }`, calls the first overload
This situation is somewhat confusing, so I tend to always specify the argument types to those pointers. But it turns out explicitly providing parentheses to argless pointers is a syntax error:
The
->foo
literal means two different things depending on where it is applied:Proc
takes the same arguments as that of the corresponding fun parameter:Proc
takes no arguments:This situation is somewhat confusing, so I tend to always specify the argument types to those pointers. But it turns out explicitly providing parentheses to argless pointers is a syntax error:
The above should be allowed, similar to how
super
andprevious_def
accept empty parentheses. (See also #10204.)The text was updated successfully, but these errors were encountered: