Aladdin - Scala Bugtracking
[#938] project: specification priority: medium category: bug
submitter assigned to status date submitted
Sean Martin won't fix 2007-02-11 15:29:22.0
subject protected static members not visible in sub-classes
code
object AbstractGame {
  protected val MAGICAL_CONSTANTS_FOR_SUBCLASSES = 42;
}
abstract class AbstractGame {
  import AbstractGame._;
  MAGICAL_CONSTANTS_FOR_SUBCLASSES;
}
class SimpleGame extends AbstractGame {
  import AbstractGame._;
  MAGICAL_CONSTANTS_FOR_SUBCLASSES;
}
what happened
Cannot compile, MAGICAL_COSNTANTS_FOR_SUBCLASS is not accessible in SimpleGame. Spec is silent on how to treat p\
rotected members of companion modules. 
what expected This has to compile if we are to be inter-operable with existing Java code that can express protected static members.
[back to overview]
Changes of this bug report
Martin  edited on  2007-03-08 10:49:34.0
I believe that any fix to this would wreck Scala's object model. I am afraid this will be one area where you have to write Java glue code.