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
classFoo@buffer= [] of Stringdefrecord(line : String)
@buffer.shift?
@buffer<< line
enddefrecord(line : String? =nil)
line ||=""yield line
# works when using `self.record`
record line
endendFoo.new.record { }
Above example fails with:
Error in line 17: instantiating 'Foo#record()'
in line 13: macro didn't expand to a valid program, it expanded to:
================================================================================
--------------------------------------------------------------------------------
1. struct line
2.
3.
4. def initialize()
5. end
6.
7.
8.
9. def clone
10. line.new()
11. end
12. end
--------------------------------------------------------------------------------
Syntax error in expanded macro: record:1: can't define struct inside def
struct line
^
================================================================================
Problem is that record call is resolved to macro record instead of #record instance method.
The text was updated successfully, but these errors were encountered:
Above example fails with:
Problem is that
record
call is resolved tomacro record
instead of#record
instance method.The text was updated successfully, but these errors were encountered: