Skip to content

stub implementation doesn't compile #13466

Closed
@KisaragiEffective

Description

@KisaragiEffective

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
}

Metadata

Metadata

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions