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

Regression in legality of SAM methods #16076

Closed
WojciechMazur opened this issue Sep 20, 2022 · 1 comment · Fixed by #16070
Closed

Regression in legality of SAM methods #16076

WojciechMazur opened this issue Sep 20, 2022 · 1 comment · 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

WojciechMazur commented Sep 20, 2022

Regression found in the Open CB #8414 for mjakubowski84/parquet4s

Compiler version

Fails with 3.2.1-RC2
Works with 3.2.1-RC1

Bisect points to 57f53d0
Might be related to #16049 and it's fix #16070

Minimized code

trait Column[V]
trait ColumnPath

trait ColumnFactory[V, C <: Column[V]]:
  def apply(columnPath: ColumnPath): C

object ColumnFactory:
  private def apply[V, C <: Column[V]](f: String => C): ColumnFactory[V, C] =
    columnPath => f(columnPath.toString())

Output

Compiling project (Scala 3.2.1-RC2, JVM)
[error] ./test.scala:9:43: ColumnFactory[V, C] is not a legal SAM type
[error] since it has a member C with possibly conflicting bounds C <: ... <: Column[V] & C
[error]     columnPath => f(columnPath.toString())
[error]                                           ^

Expectation

Should compile

@WojciechMazur WojciechMazur added itype:bug area:typer regression This worked in a previous version but doesn't anymore labels Sep 20, 2022
odersky added a commit to dotty-staging/dotty that referenced this issue Sep 20, 2022
@odersky
Copy link
Contributor

odersky commented Sep 20, 2022

I verified that #16070 fixes this as well.

Kordyjan pushed a commit to dotty-staging/dotty that referenced this issue Sep 26, 2022
mpollmeier pushed a commit to mpollmeier/dotty that referenced this issue Oct 16, 2022
@Kordyjan Kordyjan added this to the 3.2.2 milestone Aug 1, 2023
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.

3 participants