|
[#52] |
project: compiler |
priority: medium |
category: bug |
|
submitter |
assigned to |
status |
date submitted |
|
Philippe |
Martin |
fixed |
2003-07-07 10:41:49.0 |
subject |
Typing of if nodes with anonymous classes |
code |
object test {
val x = if (2 == 3) (x: Int => 0) else (x: Int => "");
val y: Int = x(2);
}
|
what happened |
There is no type error.
|
what expected |
There should have been a type error. The inferred type of x should be (Int => Any) and not (Int => Int).
A possible cause: both anonymous classes are named "anon". This could perturb method "Symbol.closure" which is used in method "Type.lub" which is used to determine the type of "if" nodes.
|
[back to overview] |