Skip to content

Instantly share code, notes, and snippets.

@bararchy
Created June 27, 2015 16:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bararchy/28f0943559247868d085 to your computer and use it in GitHub Desktop.
Save bararchy/28f0943559247868d085 to your computer and use it in GitHub Desktop.
in /home/unshadow/Desktop/git-projects/Amethyst/src/amethyst/support/sendable.cr:32: macro didn't expand to a valid program, it expanded to:
================================================================================
--------------------------------------------------------------------------------
1. case method
2.
3.
4. else
5. raise WrongInstanceMethod.new("Amethyst::Base::Controller+", "#{method}")
6. end
7.
--------------------------------------------------------------------------------
Syntax error in expanded macro: create_send:4: unexpected token: else (expecting when)
else
^
================================================================================
create_send
^~~~~~~~~~~
macro create_send
case method
{% methods = @type.methods %}
{% for m in methods %}
{% args = m.args %}
when "{{m.name.id}}"
raise WrongNumberOfArguments.new({{m.name.stringify}}, args.length, {{m.args.length}}) unless args.length == {{m.args.length}}
{{m.name.id}}{% unless args.empty? %}(
{% for arg in args %}{{arg.id}}=args[:{{arg.id}}],{% end %}){% end %}
{% end %}
else
raise WrongInstanceMethod.new({{@type.name.stringify}}, "#{method}")
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment