This page is no longer maintained — Please continue to the home page at

Re: JVM Optimizations and val.

No replies
Viktor Klang
Joined: 2008-12-17,
User offline. Last seen 1 year 27 weeks ago.
Also, please note that overriding vals means that there's one field generated per override.

On Tue, Dec 27, 2011 at 5:04 PM, Pavel Pavlov <pavel [dot] e [dot] pavlov [at] gmail [dot] com> wrote:

вторник, 27 декабря 2011 г. 22:54:47 UTC+7 пользователь Pavel Pavlov написал:
вторник, 27 декабря 2011 г. 22:42:04 UTC+7 пользователь edmondo1984 написал:
Dear Pavel,thank you for your answer. You are getting to the point.
Having a final val makes also the accessor final, right?

No. It would be impossible to override val in that case - see Viktor's example.

Sorry, I've mislooked your question. Yes, in that case accessor will be final.

Viktor Klang

Akka Tech LeadTypesafe - Enterprise-Grade Scala from the Experts

Twitter: @viktorklang

Copyright © 2012 École Polytechnique Fédérale de Lausanne (EPFL), Lausanne, Switzerland