Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Symbols declared in an annotation conflict with members declared nearby #5544

Closed
scabug opened this issue Mar 4, 2012 · 3 comments
Closed
Assignees
Milestone

Comments

@scabug
Copy link

scabug commented Mar 4, 2012

Compile this file first:

class ann(val bar: Any) extends StaticAnnotation

object Api {
  @ann({def foo = "foo!!"})
  def foo = println("foo")
}

Now compile the second file having classes of the first on the classpath:

object Test extends App {
  Api.foo
}

Here we go:

D:\Dropbox\Scratchpad\Scala\Test2.scala:2: error: ambiguous reference to overloaded definition,
both method foo in object Api of type => String
and  method foo in object Api of type => Unit
match expected type ?
  Api.foo
      ^
one error found

If both files are compiled in a single compilation run, everything is fine.

@scabug
Copy link
Author

scabug commented Mar 4, 2012

Imported From: https://issues.scala-lang.org/browse/SI-5544?orig=1
Reporter: @xeno-by

@scabug
Copy link
Author

scabug commented Mar 5, 2012

@paulp said:
The Society for the Prevention of Regressions notes with relief that the same behavior exists since at least 2.8.

@scabug
Copy link
Author

scabug commented May 18, 2012

@lrytz said:
fixed with [https://github.com/scala/scala/commit/9c6a7ad81bdb632d3da144d58210b5903b86a3e4]

@scabug scabug closed this as completed May 18, 2012
@scabug scabug added this to the 2.10.0-M3 milestone Apr 7, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants