This page is no longer maintained — Please continue to the home page at www.scala-lang.org

Abstract class inheritance w/o type params -- a possible feature?

2 replies
nick.rudnick@go...
Joined: 2011-03-27,
User offline. Last seen 42 years 45 weeks ago.
Dear all,
as highly attractive as Scala appears for stepwise replacement for Java legacy code, classes with multiple non-substitutable constructors seem to be a hindrance. 
Abstract class inheritance without type parameters appears to be a straightforward way to achieve this -- were there not the «overloaded method constructor ... cannot be applied to ()» messages.
Is there a principal hindrance to introducing a kind of abstract class that can inherit without type parameters?
Are there any arguments speaking against this?
Cheers, Nick
Peter 2
Joined: 2011-02-16,
User offline. Last seen 42 years 45 weeks ago.
Re: Abstract class inheritance w/o type params -- a possible fea

Sure, abstract classes may inherit (be inherited...) without type
parameters. Could you give an example for what you mean?

Seth Tisue
Joined: 2008-12-16,
User offline. Last seen 34 weeks 3 days ago.
Re: Abstract class inheritance w/o type params -- a possible fe

>>>>> "Nick" == Nick Rudnick writes:

Nick> Dear all, as highly attractive as Scala appears for stepwise
Nick> replacement for Java legacy code, classes with multiple
Nick> non-substitutable constructors seem to be a hindrance.

I used to angst about this sometimes, but then I found the following trick:

http://stackoverflow.com/questions/3299776/in-scala-how-can-i-subclass-a...

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