Skip to content

Commit

Permalink
Fix spawn macro for call with receiver
Browse files Browse the repository at this point in the history
  • Loading branch information
straight-shoota authored and ysbaddaden committed Mar 7, 2018
1 parent 8e66045 commit 713fa33
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions spec/std/concurrent_spec.cr
Expand Up @@ -41,4 +41,8 @@ describe "concurrent" do
spawn method_named("foo"), name: "foo"
Fiber.yield
end

it "accepts method call with receiver" do
typeof(spawn String.new)
end
end
2 changes: 1 addition & 1 deletion src/concurrent.cr
Expand Up @@ -105,7 +105,7 @@ macro spawn(call, *, name = nil)
{% end %}
) {
spawn(name: {{name}}) do
{{call.name}}(
{% if call.receiver %}{{ call.receiver }}.{% end %}{{call.name}}(
{% for arg, i in call.args %}
__arg{{i}},
{% end %}
Expand Down

0 comments on commit 713fa33

Please sign in to comment.