Aladdin - Scala Bugtracking
[#319] project: compiler priority: low category: bug
submitter assigned to status date submitted
Martin Martin fixed 2004-04-16 16:04:28.0
subject refinements don't work yet
code
object test {

  trait A { type T; }

  trait B { type T; }

  /** def functor(x: A): B { type T = x.T } */
  abstract class functor() {
    val arg: A;
    val res: B { type T = arg.T } =
      new B { type T = arg.T; };
  }

  val a = new  A { type T = String };
  /** val b: B { type T = String } = functor(a) */
  val b: B { type T = String } = {
    val tmp = new functor() { val arg = a };
    tmp.res
  }

}
what happened
 found   : test.B { type T = tmp.arg.T }
 required: test.B { type T = java.lang.String }
    tmp.res
       ^
one error found
what expected No error. This was a test in our test suite which failed once I removed support for value refinements in new's. I filed as a bug as a reminder to re-enable support for such refinements once we got the translation of refinements working.
[back to overview]
Changes of this bug report
Martin  edited on  2006-05-28 20:49:01.0