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

better error message when implicits fail due to missing type ascription #5798

Closed
scabug opened this issue May 14, 2012 · 2 comments
Closed

Comments

@scabug
Copy link

scabug commented May 14, 2012

abstract class Foo { implicit val xxx: Map[String,String] } 

object Error1 extends Foo { implicit val xxx = Map("x"->"x") }
object Error2 extends Foo { implicit val xxx = Map[String,String]("x"->"x") }
object Error3 extends Foo { override implicit val xxx = Map[String,String]("x"->"x") }
//error: value -> is not a member of String

object Ok1 extends Foo { implicit val xxx: Map[String,String] = Map("x"->"x") }
object Ok2 extends Foo { implicit val xxx = Map(("x","x")) }
@scabug
Copy link
Author

scabug commented May 14, 2012

Imported From: https://issues.scala-lang.org/browse/SI-5798?orig=1
Reporter: @refried
Affected Versions: 2.9.1, 2.10.0-M3
See #5265

@som-snytt
Copy link

The example compiles since 2.11. The linked ticket is to warn in any case.

@scala scala deleted a comment from scabug Dec 17, 2019
@SethTisue SethTisue modified the milestones: Backlog, 2.11.0 Dec 17, 2019
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

3 participants