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 for type inference/ method overload in katrix/dataprism #21682

Open
WojciechMazur opened this issue Oct 1, 2024 · 0 comments · May be fixed by #21741
Open

Regression for type inference/ method overload in katrix/dataprism #21682

WojciechMazur opened this issue Oct 1, 2024 · 0 comments · May be fixed by #21741
Assignees
Labels
area:typer itype:bug regression This worked in a previous version but doesn't anymore

Comments

@WojciechMazur
Copy link
Contributor

Based on OpenCB failure in katrix/dataprism - build logs

Compiler version

Last good release: 3.6.0-RC1-bin-20240922-22ed2fb-NIGHTLY
First bad release: 3.6.0-RC1-bin-20240923-e5f7272-NIGHTLY
Bisect points to 9f90ad0

Minimized code

sealed abstract class Gen[+T] 
given [T]: Conversion[T, Gen[T]] = ???

trait Show[T]
given Show[Boolean] = ???
given [A: Show, B: Show, C: Show]: Show[(A, B, C)] = ???

object ForAll:
  def apply[A1: Show, B](f: A1 => B): Unit = ???
  def apply[A1: Show, A2: Show, B](f: (A1, A2) => B): Unit = ???
  def apply[A: Show, B](gen: Gen[A])(f: A => B): Unit = ???
  
@main def Test =
  ForAll: (b1: Boolean, b2: Boolean, b3: Boolean) =>
    ???

Output

[error] ./test.scala:13:8
[error] No given instance of type Show[(Boolean, Boolean, Boolean) => Nothing] was found for a context parameter of method apply in object ForAll
[error]     ???

Expectation

Should compile

Case 2

object ForAll:
  def apply[A1, B](f: A1 => B): Unit = ???
  def apply[A1, A2, B](f: (A1, A2) => B): Unit = ???
  
@main def Test =
  ForAll: (b1: Boolean, b2: Boolean, b3: Boolean) =>
    ???
[error] ./test.scala:21:3
[error] None of the overloaded alternatives of method apply in object ForAll with types
[error]  [A1, A2, B](f: (A1, A2) => B): Unit
[error]  [A1, B](f: A1 => B): Unit
[error] match arguments ((Boolean, Boolean, Boolean) => Nothing)
[error] 
[error] where:    A1 is a type variable
[error]           A2 is a type variable
[error]           B  is a type variable
[error]   ForAll: (b1: Boolean, b2: Boolean, b3: Boolean) =>
[error]   ^^^^^^
@WojciechMazur WojciechMazur added itype:bug area:typer regression This worked in a previous version but doesn't anymore labels Oct 1, 2024
@dwijnand dwijnand linked a pull request Oct 9, 2024 that will close this issue
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.

2 participants