Statically decide if a Scala class is immutable

Viewed 915

I just attended a Scala-lecture at a summer school. The lecturer got the following question:

- "Is there any way for the compiler to tell if a class is immutable?"

The lecturer responded

- "No, there isn't. It would be very nice if it could."

I was surprised. Isnt't it just to check if the class contains any var-members?

6 Answers
Related