Skip to content

Regression in legality of SAM methods #16076

Closed
@WojciechMazur

Description

@WojciechMazur

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

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions