Details
-
Bug
-
Status: Closed
-
Critical
-
Resolution: Fixed
-
None
-
None
-
None
Description
def list = [10,20,30] Iterator it = list.iterator() shouldFail (ClassCastException) { it++ }
In this program the it++ should fail, because the iterator returns a number and a number is no Iterator so it is not assignable to the variable named it of type Iterator. But the compiler ignores the type here and fails to implement the assignment correctly