Aladdin - Scala Bugtracking
[#1029] project: compiler priority: low category: bug
submitter assigned to status date submitted
Sean Martin noise 2007-03-28 16:36:08.0
subject compiler confused about one method being two different methods
code
see test/files/run/bitsets.scala
what happened
bitsets.scala:33: error: ambiguous reference to overloaded definition,
both method toArray in class BitSet of type [B >: scala.Int]scala.Array[B]
and  method toArray in class BitSet of type => scala.Array[scala.Int]
match expected type ?
  Console.println("ma0 = " + ms0.toArray.toList)
                                ^
bitsets.scala:34: error: ambiguous reference to overloaded definition,
both method toArray in class BitSet of type [B >: scala.Int]scala.Array[B]
and  method toArray in class BitSet of type => scala.Array[scala.Int]
match expected type ?
  Console.println("ma1 = " + ms1.toArray.toList)
                                ^
bitsets.scala:35: error: ambiguous reference to overloaded definition,
both method toArray in class BitSet of type [B >: scala.Int]scala.Array[B]
and  method toArray in class BitSet of type => scala.Array[scala.Int]
match expected type ?
  Console.println("ma2 = " + ms2.toArray.toList)
                                ^
bitsets.scala:66: error: ambiguous reference to overloaded definition,
both method toArray in class BitSet of type [B >: scala.Int]scala.Array[B]
and  method toArray in class BitSet of type => scala.Array[scala.Int]
match expected type ?
  Console.println("ia0 = " + is0.toArray.toList)
                                ^
bitsets.scala:67: error: ambiguous reference to overloaded definition,
both method toArray in class BitSet of type [B >: scala.Int]scala.Array[B]
and  method toArray in class BitSet of type => scala.Array[scala.Int]
match expected type ?
  Console.println("ia1 = " + is1.toArray.toList)
                                ^
bitsets.scala:68: error: ambiguous reference to overloaded definition,
both method toArray in class BitSet of type [B >: scala.Int]scala.Array[B]
and  method toArray in class BitSet of type => scala.Array[scala.Int]
match expected type ?
  Console.println("ia2 = " + is2.toArray.toList)
                                ^
bitsets.scala:69: error: ambiguous reference to overloaded definition,
both method toArray in class BitSet of type [B >: scala.Int]scala.Array[B]
and  method toArray in class BitSet of type => scala.Array[scala.Int]
match expected type ?
  Console.println("ia3 = " + is3.toArray.toList)
                                ^
7 errors found
what expected Should compile without error.
[back to overview]
Changes of this bug report
Martin  edited on  2007-03-28 16:37:25.0
Why? They are two different types.
Sean  edited on  2007-03-28 16:41:18.0
Not a bug. There was actually another toArray method in another class named BitSet.