for
class Y
def initialize(@a : String)
end
getter a
end
class X
macro test(name)
@{{name}} = y.{{name}}
end
@a : String
def initialize(y : Y)
test a
end
end
I got
instance variable '@a' of X was not initialized directly in all of the 'initialize' methods, rendering it nilable. Indirect initialization is not supported.
why? and set @a to nil did solve the problem but that's not a good workaround in my opinion.
Is it a bug, a design limit or just I'm not doing the right thing?