Skip to content

Implicit dependent functions typing behaves incorrectly #5833

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

Closed
guyde2011 opened this issue Feb 1, 2019 · 0 comments
Closed

Implicit dependent functions typing behaves incorrectly #5833

guyde2011 opened this issue Feb 1, 2019 · 0 comments

Comments

@guyde2011
Copy link

object Dependent{
  def x: ( (i: Int) |=> Int ) = ???
  def y: ( (i: Int) |=> Int ) = x
}
object Independent{
  def x: ( Int |=> Int ) = ???
  def y: ( Int |=> Int ) = x
}
object NarrowDependent{
  def x: ( Int |=> Int ) = ???
  def y: ( (i: Int) |=> Int ) = x 
}
object WidenDependent{
  def x: ( (i: Int) |=> Int ) = ???
  def y: ( Int |=> Int ) = x 
}

Independent, NarrowDependent are compiled with no errors.
Dependent, WidenDependent both fail to compile:
Dependent:

Found:    => (i: Int) |=> Int(Dependent.x)
Required: Int

WidenDependent:

Found:    => (i: Int) |=> Int(WidenDependent.x)
Required: Int
@guyde2011 guyde2011 changed the title implicit dependent functions behave incorrectly Implicit dependent functions behave incorrectly Feb 1, 2019
@guyde2011 guyde2011 changed the title Implicit dependent functions behave incorrectly Implicit dependent functions typing behaves incorrectly Feb 1, 2019
odersky added a commit to dotty-staging/dotty that referenced this issue Feb 4, 2019
biboudis pushed a commit that referenced this issue Feb 6, 2019
Fix #5833: Refine condition what constitutes an IFT in adapt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant