Created
June 27, 2015 16:08
-
-
Save bararchy/28f0943559247868d085 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | |
^~~~~~~~~~~ | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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