Aladdin - Scala Bugtracking
[#522] project: compiler priority: medium category: bug
submitter assigned to status date submitted
Lex Martin fixed 2006-01-27 18:41:37.0
subject clash between class and imported method with same name
code
package imptwice

class foo(s: String);

object Util {
  def foo(s: String) = new foo(s)
}

import imptwice.Util._


object User {
  def main(args: Array[String]) = {
    foo("blah")
  }
}
what happened
The first time you compile, this code is fine.  The second time, it gives you:
test.scala:14 error: not found: value foo
    foo("blah")
    ^
one error found
I have seen this problem a lot. Sometimes instead of saying "definition not found", it says that there are conf\ licting definitions of the symbol in question.
what expected It should compile fine.
[back to overview]
Changes of this bug report
Lex  edited on  2006-01-27 18:41:53.0
Lex  edited on  2006-01-27 18:42:09.0
Martin  edited on  2006-01-28 19:58:12.0