Skip to content

stub implementation doesn't compile #13466

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
KisaragiEffective opened this issue Sep 3, 2021 · 1 comment · Fixed by #13529
Closed

stub implementation doesn't compile #13466

KisaragiEffective opened this issue Sep 3, 2021 · 1 comment · Fixed by #13529
Assignees
Milestone

Comments

@KisaragiEffective
Copy link
Contributor

KisaragiEffective commented Sep 3, 2021

Compiler version

3.0.2

Minimized code

opaque type Finally[A] = A

trait SomeTrait[F[_]] {
  def foo: F[Unit]
  def withTV[A]: F[A]
  def withTV2[A, B]: F[(A, B)]
}

given none: SomeTrait[Finally] with {
  // the compiler generates stub
}

Output

stub implementation, which is in suggestedStub

given suggestedStub: SomeTrait[Finally] with {
  /** As seen from module class none$, the missing signatures are as follows.
  *  For convenience, these are usable as stub implementations.
  */
  def foo: F[Unit] = ???
  def withTV: [A] => F[A] = ???
  def withTV2: [A, B] => F[(A, B)] = ???
}

Expectation

the code which is in expected

given expected: SomeTrait[Finally] with {
  // all: the SomeTrait's F should be expanded with `Finally`
  def foo: Finally[Unit] = ??? // same
  def withTV[A]: Finally[A] = ??? // the type-variable declaration must be followed by identifier
  def withTV2[A, B]: Finally[(A, B)] = ??? // same as withTV
}
@griggt
Copy link
Contributor

griggt commented Sep 3, 2021

Related: #13076

@griggt griggt self-assigned this Sep 7, 2021
griggt added a commit to griggt/dotty that referenced this issue Sep 14, 2021
griggt added a commit to griggt/dotty that referenced this issue Sep 22, 2021
olsdavis pushed a commit to olsdavis/dotty that referenced this issue Apr 4, 2022
@Kordyjan Kordyjan added this to the 3.1.1 milestone Aug 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants