Skip to content

Regression in getkyo/kyo using scalatest/scalatest #22068

Closed
@WojciechMazur

Description

@WojciechMazur

Based on OpenCB failure in getkyo/kyo - build logs

Compiler version

Last good release: 3.6.4-RC1-bin-20241121-5d1d274-NIGHTLY
First bad release: 3.6.4-RC1-bin-20241122-64411b6-NIGHTLY
Bisect points to 26ecda5

Minimized code

trait AnyFreeSpecLike:
  inline implicit def convertToFreeSpecStringWrapper(s: String): FreeSpecStringWrapper = ???
  protected final class FreeSpecStringWrapper(string: String):
    infix def in(testFun: => Any): Unit = ???


import types.Tag.*
class TagTest extends AnyFreeSpecLike{
  inline def test[T1, T2](using k1: Union[T1], k2: Union[T2]): Unit =
    "T1 <:< T2" in {
        val kresult = k1 <:< k2
        ???
    }
  class A
  class B extends A
  class C extends A
  test[B | C, A]
}

object types:
  opaque type Tag[A] = String
  object Tag:
    inline given apply[A]: Tag[A] = ???
    type Full[A] = Tag[A] | Set[A]
    sealed trait Set[A] extends Any
    case class Union[A](tags: Seq[Tag[Any]]) extends AnyVal with Set[A]:
      infix def <:<[B](t2: Full[B]): Boolean = ???
    object Union:
      inline given apply[A]: Union[A] = ???

Output

-- [E007] Type Mismatch Error: /Users/wmazur/projects/scala/sandbox/test.scala:17:16 -----------------------------------------------
17 |  test[B | C, A]
   |                ^
   |                Found:    (k2$proxy1 : types.type{type Tag[A] = String}#Tag#Union[TagTest.this.A])
   |                Required: String
   |
   | longer explanation available when compiling with `-explain`

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