by chrisseaton · 6y ago · 0 comments
I think this is long-gone isn't it? It's local now.
> parser is hard to reuse outside of the compiler itself
A problem we repeat again and again!
module Example
def self.some_method
"string"
end
class Foo
getter :var1
def initialize
@var1 = SomeUtilities.something
end
end
module SomeUtilities
def self.something
Example.some_method
end
def self.do_something_with_string(input : String)
puts input
end
end
end
Example::SomeUtilities.do_something_with_string(Example::Foo.new)
If you change Example.some_method to return :symbol, you now get a type error on the final line.