Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

In Scala, defining a method and a variable with the same name would be a compile-time error.


A situation like the OP's would run in an infinite loop even in Scala. There's no compile-time error in Scala when you have a method call itself, which is what the OP is describing, and his variable also wasn't named the same as the method: "@name" vs "name".




Consider applying for YC's Fall 2026 batch! Applications are open till July 27.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: