Aladdin - Scala Bugtracking
[#793] project: compiler priority: low category: bug
submitter assigned to status date submitted
Iulian Iulian fixed 2006-11-01 18:51:33.0
subject default constructor for Java classes
code
// y.java
public class y {
  
  private y(String s) {
  }
}

// scala
object Main extends Application {
  val b = new y
}
what happened
Silent compilation, but fails at runtime. The reason is that the symbol loader will add a default public constru\
ctor for a java class when no constructor is in scope. Since private members are not even entered in scope, it w\
rongly adds this one.
what expected a type error.
[back to overview]
Changes of this bug report