Navigation Menu

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

Ambiguous overloaded method error when calling sym.getter #8086

Closed
scabug opened this issue Dec 16, 2013 · 4 comments
Closed

Ambiguous overloaded method error when calling sym.getter #8086

scabug opened this issue Dec 16, 2013 · 4 comments
Assignees
Milestone

Comments

@scabug
Copy link

scabug commented Dec 16, 2013

(using latest 2.11.0-SNAPSHOT)

scala> val sym = typeOf[String].typeSymbol
sym: $r.intp.global.Symbol = class String

scala> sym.getter
<console>:39: error: ambiguous reference to overloaded definition,
both method getter in class Symbol of type (base: $r.intp.global.Symbol)$r.intp.global.Symbol
and  method getter in class SymbolContextApiImpl of type => $r.intp.global.Symbol
match expected type ?
              sym.getter
                  ^
@scabug
Copy link
Author

scabug commented Dec 16, 2013

Imported From: https://issues.scala-lang.org/browse/SI-8086?orig=1
Reporter: @dragos
Affected Versions: 2.11.0

@scabug
Copy link
Author

scabug commented Dec 16, 2013

@retronym said:
I think the overload resolution is as specced.

scala> trait T { def foo = 0 }; object O extends T { def foo(a: Any) = 0 }; O.foo
<console>:38: error: ambiguous reference to overloaded definition,
both method foo in object O of type (a: Any)Int
and  method foo in trait T of type => Int
match expected type ?
        O.foo
          ^

But its at least an API bug.

@scabug
Copy link
Author

scabug commented Dec 16, 2013

@xeno-by said:
Linked to #8063

@scabug
Copy link
Author

scabug commented Feb 1, 2014

@xeno-by said:
scala/scala#3452

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