Skip to content

Regression in legality of path dependent types #16049

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
WojciechMazur opened this issue Sep 15, 2022 · 2 comments · Fixed by #16070
Closed

Regression in legality of path dependent types #16049

WojciechMazur opened this issue Sep 15, 2022 · 2 comments · Fixed by #16070
Assignees
Labels
area:typer itype:bug regression This worked in a previous version but doesn't anymore
Milestone

Comments

@WojciechMazur
Copy link
Contributor

Regression found in Open CB #7361 for scalanlp/breeze
Bisect points to 57f53d0

Compiler version

3.2.2-RC1-nightly
Works in 3.2.1-RC1

Minimized code

trait BatchDiffFunction[T]

abstract class FirstOrderMinimizer[T, DF <: BatchDiffFunction[T]]:
  type State = FirstOrderMinimizer.State[T]

object FirstOrderMinimizer:
  case class State[+T](x: T)

  class OptParams:
    def iterations[T](init: T): Iterator[FirstOrderMinimizer[T, BatchDiffFunction[T]]#State] = ???

Output

Compiling project (Scala 3.2.2-RC1-bin-20220913-a3c0bef-NIGHTLY, JVM)
[error] ./test.scala:10:42: 
[error] FirstOrderMinimizer[T, BatchDiffFunction[T]] is not a legal path
[error] since it has a member DF with possibly conflicting bounds BatchDiffFunction[T] <: ... <: BatchDiffFunction[T] & BatchDiffFunction[T]
[error]     def iterations[T](init: T): Iterator[FirstOrderMinimizer[T, BatchDiffFunction[T]]#State] = ???
[error]  

Expectation

Should compile

@WojciechMazur WojciechMazur added the regression This worked in a previous version but doesn't anymore label Sep 15, 2022
@odersky
Copy link
Contributor

odersky commented Sep 15, 2022

I can't reproduce this on latest main. (?)

@prolativ
Copy link
Contributor

I can confirm getting a compilation error with 3.2.2-RC1-bin-20220916-afc6ce4-NIGHTLY

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:typer itype:bug regression This worked in a previous version but doesn't anymore
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants