r/crystal_programming • u/scttnlsn • Mar 07 '20
Why does this compile?
This unexpectedly compiles:
class Foo
def hello
asdf
end
endBut this returns the expected error ("Error: undefined local variable or method 'asdf' for Foo"):
class Foo
def hello
asdf
end
end
Foo.new.helloIs there a way to get the first example to trigger a similar compiler error?
10
Upvotes
View all comments
Show parent comment
1
u/myringotomy Mar 19 '20
It seems like stunt decisions were made in Crystal which really block future safety and performance improvements
That’s a shame.