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

more precise expected type for selections #8404

Open
scabug opened this issue Mar 12, 2014 · 6 comments
Open

more precise expected type for selections #8404

scabug opened this issue Mar 12, 2014 · 6 comments
Labels
fixed in Scala 3 This issue does not exist in the Scala 3 compiler (https://github.com/lampepfl/dotty/) infer

Comments

@scabug
Copy link

scabug commented Mar 12, 2014

This compiles in dotty (presumably because Some("rd").getOrElse is type checked with expected type String => Modifier). Can we make it work as well?

trait Modifier
implicit def stringNode(v: String): Modifier = ???
val s: Modifier = Some("rd").getOrElse("")
@scabug
Copy link
Author

scabug commented Mar 12, 2014

Imported From: https://issues.scala-lang.org/browse/SI-8404?orig=1
Reporter: @adriaanm

@scabug
Copy link
Author

scabug commented Mar 14, 2014

@paulp said:
Duplicate of #2720.

@scabug
Copy link
Author

scabug commented Mar 14, 2014

@paulp said:
I guess five years is long enough for everyone to forget everything. (Not me, I forget nothing.)

@scabug
Copy link
Author

scabug commented Mar 14, 2014

@som-snytt said:
It is true that the earlier ticket has the slightly more thrilling formulation.

But not everyone has a list of scurrilous issues tattooed on the inside of their left biceps.

This will replace or at least supplement the related puzzler:

http://scalapuzzlers.com/#pzzlr-032

when the puzzler guys have returned from vacation.

@scabug
Copy link
Author

scabug commented Mar 16, 2014

Li Haoyi (lihaoyi) said:
This doesn't work either

trait Modifier
implicit def arrayNode[T](v: Array[T]): Modifier = ???
val s: Modifier = Array("omg")

Not sure if related or not, but definitely borked

@scabug
Copy link
Author

scabug commented Jun 23, 2016

@adriaanm said:
Let's experiment under a flag in 2.12.x

@scabug scabug added the infer label Apr 7, 2017
@scabug scabug added this to the 2.13.0-M1 milestone Apr 7, 2017
@adriaanm adriaanm modified the milestones: 2.13.0-M1, 2.13.0-M2 Apr 14, 2017
@adriaanm adriaanm modified the milestones: 2.13.0-M2, 2.13.0-M3 Jun 26, 2017
@adriaanm adriaanm modified the milestones: 2.13.0-M3, 2.13.0-M4 Jan 30, 2018
@lrytz lrytz removed this from the 2.13.0-M4 milestone Apr 23, 2018
@adriaanm adriaanm removed their assignment Sep 28, 2018
@smarter smarter added the fixed in Scala 3 This issue does not exist in the Scala 3 compiler (https://github.com/lampepfl/dotty/) label Oct 19, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fixed in Scala 3 This issue does not exist in the Scala 3 compiler (https://github.com/lampepfl/dotty/) infer
Projects
None yet
Development

No branches or pull requests

4 participants