Aladdin - Scala Bugtracking
[#228] project: compiler priority: medium category: bug
submitter assigned to status date submitted
Stephane Martin fixed 2003-11-18 13:35:20.0
subject Cannot access protected constructor
code
import java.lang.reflect.AccessibleObject;

class Test extends AccessibleObject;
what happened
Test.scala:3: constructor java.lang.reflect.AccessibleObject cannot be accessed in java.lang.reflect
class Test extends AccessibleObject {
                   ^
one error found
what expected No error (same example works fine in Java)
[back to overview]
Changes of this bug report
Stephane  edited on  2003-11-18 13:35:34.0
Matthias  edited on  2003-11-25 11:27:11.0
This is probably my "bug", but currently, I have no clear picture about the status of overloading. In the old days (maybe still today), all overloaded methods had to have the same access modifiers. For Java classes the classloader of scalac synthesizes this modifier set. One consequence of this is that whenever there is a private constructor, all constructors will get private. Exactly this happens in Stephane's example. Did this change recently, Martin?
Matthias  edited on  2003-11-25 11:55:41.0
It's not the code for loading classes. It must be a bug in the constructor handling. For Java classes it's unclear what the primary constructor is. Maybe this has some influence...
Martin  edited on  2004-01-08 16:51:27.0