Aladdin - Scala Bugtracking
[#209] project: compiler priority: high category: bug
submitter assigned to status date submitted
Nikolay Martin fixed 2003-10-23 14:26:26.0
subject Spurious type mismatch error when targeting the MSIL backend
code
object test {
  def main(args: Array[String]): Unit = {
    val s: java.lang.String = "ssssssssssss".substring(4); // type mismatch!?!
    val u: Unit = wait(); // type mismatch
    val v: Unit = System.out.println(); // ok
  }
}
what happened
When compiling with -target:msil I get type mismatch errors. Compiling with the jvm backend yields no error\
s.

test.scala:3: type mismatch;
 found   : String
 required: java.lang.String
    val s: java.lang.String = "ssssssssssss".substring(4);
                                                      ^
test.scala:4: type mismatch;
 found   : void
 required: scala.Unit
    val u: Unit = wait();
                      ^
what expected No errors
[back to overview]
Changes of this bug report
Nikolay  edited on  2003-10-23 14:31:04.0
tried to reformat the 'what happened' field
Nikolay  edited on  2003-10-23 17:10:42.0
The MSIL backed initialization was triggerring premature type evaluation.